// Path: src/main/java/org/madlonkay/supertmxmerge/data/DiffAnalysis.java
// public class DiffAnalysis<T> {
//     public final Set<T> deleted;
//     public final Set<T> added;
//     public final Set<T> modified;
//     
//     public DiffAnalysis(Set<T> deleted, Set<T> added, Set<T> modified) {
//         this.deleted = Collections.unmodifiableSet(deleted);
//         this.added = Collections.unmodifiableSet(added);
//         this.modified = Collections.unmodifiableSet(modified);
//     }
// }
// 
// Path: src/main/java/org/madlonkay/supertmxmerge/data/MergeAnalysis.java
// public class MergeAnalysis<K,V> {
//     public final Set<K> deleted;
//     public final Set<K> added;
//     public final Map<K, V> modified;
//     public final Set<K> conflicts;
//     
//     public static MergeAnalysis unmodifiableAnalysis(MergeAnalysis analysis) {
//         return new MergeAnalysis(Collections.unmodifiableSet(analysis.deleted),
//                 Collections.unmodifiableSet(analysis.added),
//                 Collections.unmodifiableMap(analysis.modified),
//                 Collections.unmodifiableSet(analysis.conflicts));
//     }
//     
//     public MergeAnalysis(Set<K> deleted, Set<K> added, Map<K,V> modified, Set<K> conflicts) {
//         this.deleted = deleted;
//         this.added = added;
//         this.modified = modified;
//         this.conflicts = conflicts;
//     }
//     
//     public boolean hasConflicts() {
//         return !conflicts.isEmpty();
//     }
// }


import java.util.HashMap;
import java.util.Map;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.madlonkay.supertmxmerge.data.DiffAnalysis;
import org.madlonkay.supertmxmerge.data.MergeAnalysis;
        Map<String,String> after = new HashMap<String, String>(before);
        
        DiffAnalysis<String> result = DiffUtil.mapDiff(before, after); 
        checkAnalysis(result, 0, 0, 0);
        
        before.put("d", "four");
        result = DiffUtil.mapDiff(before, after);
        checkAnalysis(result, 0, 1, 0);
        
        after.put("e", "five");
        result = DiffUtil.mapDiff(before, after); 
        checkAnalysis(result, 1, 1, 0);
        
        before.put("f", "six");
        after.put("f", "six?");
        result = DiffUtil.mapDiff(before, after);
        checkAnalysis(result, 1, 1, 1);
    }

    /**
     * Test of mapMerge method, of class DiffUtil.
     */
    @Test
    public void testMapMerge() {
        Map<String,String> base = makeMap(
                new String[] { "a", "b", "c" },
                new String[] { "one", "two", "three" });
        Map<String,String> left = new HashMap<String, String>(base);
        Map<String,String> right = new HashMap<String, String>(base);
        
// Path: src/main/java/org/madlonkay/supertmxmerge/data/DiffAnalysis.java
// public class DiffAnalysis<T> {
//     public final Set<T> deleted;
//     public final Set<T> added;
//     public final Set<T> modified;
//     
//     public DiffAnalysis(Set<T> deleted, Set<T> added, Set<T> modified) {
//         this.deleted = Collections.unmodifiableSet(deleted);
//         this.added = Collections.unmodifiableSet(added);
//         this.modified = Collections.unmodifiableSet(modified);
//     }
// }
// 
// Path: src/main/java/org/madlonkay/supertmxmerge/data/MergeAnalysis.java
// public class MergeAnalysis<K,V> {
//     public final Set<K> deleted;
//     public final Set<K> added;
//     public final Map<K, V> modified;
//     public final Set<K> conflicts;
//     
//     public static MergeAnalysis unmodifiableAnalysis(MergeAnalysis analysis) {
//         return new MergeAnalysis(Collections.unmodifiableSet(analysis.deleted),
//                 Collections.unmodifiableSet(analysis.added),
//                 Collections.unmodifiableMap(analysis.modified),
//                 Collections.unmodifiableSet(analysis.conflicts));
//     }
//     
//     public MergeAnalysis(Set<K> deleted, Set<K> added, Map<K,V> modified, Set<K> conflicts) {
//         this.deleted = deleted;
//         this.added = added;
//         this.modified = modified;
//         this.conflicts = conflicts;
//     }
//     
//     public boolean hasConflicts() {
//         return !conflicts.isEmpty();
//     }
// }


// Path: src/test/java/org/madlonkay/supertmxmerge/util/DiffUtilTest.java
import java.util.HashMap;
import java.util.Map;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.madlonkay.supertmxmerge.data.DiffAnalysis;
import org.madlonkay.supertmxmerge.data.MergeAnalysis;

        Map<String,String> after = new HashMap<String, String>(before);
        
        DiffAnalysis<String> result = DiffUtil.mapDiff(before, after); 
        checkAnalysis(result, 0, 0, 0);
        
        before.put("d", "four");
        result = DiffUtil.mapDiff(before, after);
        checkAnalysis(result, 0, 1, 0);
        
        after.put("e", "five");
        result = DiffUtil.mapDiff(before, after); 
        checkAnalysis(result, 1, 1, 0);
        
        before.put("f", "six");
        after.put("f", "six?");
        result = DiffUtil.mapDiff(before, after);
        checkAnalysis(result, 1, 1, 1);
    }

    /**
     * Test of mapMerge method, of class DiffUtil.
     */
    @Test
    public void testMapMerge() {
        Map<String,String> base = makeMap(
                new String[] { "a", "b", "c" },
                new String[] { "one", "two", "three" });
        Map<String,String> left = new HashMap<String, String>(base);
        Map<String,String> right = new HashMap<String, String>(base);
        
        MergeAnalysis<String,String> result = DiffUtil.mapMerge(base, left, right);