package org.mutabilitydetector.runtime;

import org.mutabilitydetector.AnalysisResult;
import org.mutabilitydetector.AnalysisSession;
import org.mutabilitydetector.IsImmutable;
import org.mutabilitydetector.ThreadUnsafeAnalysisSession;
import org.mutabilitydetector.AnalysisSession.RequestedAnalysis;
import org.mutabilitydetector.locations.Dotted;

public final class RuntimeAnalysisExample {
    private final AnalysisSession analysisSession = ThreadUnsafeAnalysisSession.createWithCurrentClassPath();

    private void run(Object requiredToBeImmutable) {
        RequestedAnalysis requestedAnalysis = analysisSession.resultFor(Dotted.fromClass(requiredToBeImmutable.getClass()));
        AnalysisResult result = requestedAnalysis.result;
        if(result.isImmutable.equals(IsImmutable.IMMUTABLE)) {
            // rest safe in the knowledge the class is immutable, share across threads with joyful abandon
        } else if(result.isImmutable.equals(IsImmutable.NOT_IMMUTABLE)) {
            // be careful here: make defensive copies, don't publish the reference, read Java Concurrency In Practice right away!
        }
    }
    
    public static void main(String[] args) {
        new RuntimeAnalysisExample().run(makeParam());
    }
    
    private static Object makeParam() {
        return new java.util.Date();
    }

}

@@ -559,16 +559,105 @@
         
+Dotted runtimeClassOfGivenObject = Dotted.fromClass(requiredToBeImmutable.getClass());%0A%09%09
 Requeste
@@ -716,58 +716,33 @@
 For(
-Dotted.fromClass(requiredToBeImmutable.getClass())
+runtimeClassOfGivenObject
 );%0A 
@@ -798,16 +798,25 @@
 result;%0A
+        %0A
         
@@ -925,16 +925,29 @@
 lass is 
+%0A        %09// 
 immutabl
@@ -1119,16 +1119,29 @@
 copies, 
+%0A        %09// 
 don't pu
@@ -1161,16 +1161,29 @@
 erence, 
+%0A        %09// 
 read Jav

Try to make example more readable.