// Path: src/main/java/com/cedarsoftware/util/DeepEquals.java
// public static boolean deepEquals(Object a, Object b)
// {
//     return deepEquals(a, b, new HashMap());
// }
// 
// Path: src/main/java/com/cedarsoftware/util/GraphComparator.java
// public enum Command
// {
//     ARRAY_SET_ELEMENT("array.setElement"),
//     ARRAY_RESIZE("array.resize"),
//     OBJECT_ASSIGN_FIELD("object.assignField"),
//     OBJECT_ORPHAN("object.orphan"),
//     OBJECT_FIELD_TYPE_CHANGED("object.fieldTypeChanged"),
//     SET_ADD("set.add"),
//     SET_REMOVE("set.remove"),
//     MAP_PUT("map.put"),
//     MAP_REMOVE("map.remove"),
//     LIST_RESIZE("list.resize"),
//     LIST_SET_ELEMENT("list.setElement");
// 
//     private String name;
//     Command(final String name)
//     {
//         this.name = name.intern();
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public static Command fromName(String name)
//     {
//         if (name == null || "".equals(name.trim()))
//         {
//             throw new IllegalArgumentException("Name is required for Command.forName()");
//         }
// 
//         name = name.toLowerCase();
//         for (Command t : Command.values())
//         {
//             if (t.getName().equals(name))
//             {
//                 return t;
//             }
//         }
// 
//         throw new IllegalArgumentException("Unknown Command enum: " + name);
//     }
// }


import com.cedarsoftware.util.io.JsonReader;
import com.cedarsoftware.util.io.JsonWriter;
import org.junit.Test;
import java.util.*;
import static com.cedarsoftware.util.DeepEquals.deepEquals;
import static com.cedarsoftware.util.GraphComparator.Delta.Command.*;
import static org.junit.Assert.*;
        assertTrue(errors.size() == 1);
        GraphComparator.DeltaError error = errors.get(0);
        assertTrue(error.getError().contains("LIST_SET_ELEMENT"));
        assertTrue(error.getError().contains("failed"));
    }

    @Test
    public void testDeltaSetterGetter()
    {
        GraphComparator.Delta delta = new GraphComparator.Delta(0, "foo", null, null, null, null);
        delta.setCmd(OBJECT_ASSIGN_FIELD);
        assertEquals(OBJECT_ASSIGN_FIELD, delta.getCmd());
        delta.setFieldName("field");
        assertEquals("field", delta.getFieldName());
        delta.setId(9);
        assertEquals(9, delta.getId());
        delta.setOptionalKey(6);
        assertEquals(6, delta.getOptionalKey());
        delta.setSourceValue('a');
        assertEquals('a', delta.getSourceValue());
        delta.setTargetValue(Boolean.TRUE);
        assertEquals(true, delta.getTargetValue());
        assertNotNull(delta.toString());
    }

    @Test
    public void testDeltaCommandBadEnums() throws Exception
    {
        try
        {
// Path: src/main/java/com/cedarsoftware/util/DeepEquals.java
// public static boolean deepEquals(Object a, Object b)
// {
//     return deepEquals(a, b, new HashMap());
// }
// 
// Path: src/main/java/com/cedarsoftware/util/GraphComparator.java
// public enum Command
// {
//     ARRAY_SET_ELEMENT("array.setElement"),
//     ARRAY_RESIZE("array.resize"),
//     OBJECT_ASSIGN_FIELD("object.assignField"),
//     OBJECT_ORPHAN("object.orphan"),
//     OBJECT_FIELD_TYPE_CHANGED("object.fieldTypeChanged"),
//     SET_ADD("set.add"),
//     SET_REMOVE("set.remove"),
//     MAP_PUT("map.put"),
//     MAP_REMOVE("map.remove"),
//     LIST_RESIZE("list.resize"),
//     LIST_SET_ELEMENT("list.setElement");
// 
//     private String name;
//     Command(final String name)
//     {
//         this.name = name.intern();
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public static Command fromName(String name)
//     {
//         if (name == null || "".equals(name.trim()))
//         {
//             throw new IllegalArgumentException("Name is required for Command.forName()");
//         }
// 
//         name = name.toLowerCase();
//         for (Command t : Command.values())
//         {
//             if (t.getName().equals(name))
//             {
//                 return t;
//             }
//         }
// 
//         throw new IllegalArgumentException("Unknown Command enum: " + name);
//     }
// }


// Path: src/test/java/com/cedarsoftware/util/TestGraphComparator.java
import com.cedarsoftware.util.io.JsonReader;
import com.cedarsoftware.util.io.JsonWriter;
import org.junit.Test;
import java.util.*;
import static com.cedarsoftware.util.DeepEquals.deepEquals;
import static com.cedarsoftware.util.GraphComparator.Delta.Command.*;
import static org.junit.Assert.*;

        assertTrue(errors.size() == 1);
        GraphComparator.DeltaError error = errors.get(0);
        assertTrue(error.getError().contains("LIST_SET_ELEMENT"));
        assertTrue(error.getError().contains("failed"));
    }

    @Test
    public void testDeltaSetterGetter()
    {
        GraphComparator.Delta delta = new GraphComparator.Delta(0, "foo", null, null, null, null);
        delta.setCmd(OBJECT_ASSIGN_FIELD);
        assertEquals(OBJECT_ASSIGN_FIELD, delta.getCmd());
        delta.setFieldName("field");
        assertEquals("field", delta.getFieldName());
        delta.setId(9);
        assertEquals(9, delta.getId());
        delta.setOptionalKey(6);
        assertEquals(6, delta.getOptionalKey());
        delta.setSourceValue('a');
        assertEquals('a', delta.getSourceValue());
        delta.setTargetValue(Boolean.TRUE);
        assertEquals(true, delta.getTargetValue());
        assertNotNull(delta.toString());
    }

    @Test
    public void testDeltaCommandBadEnums() throws Exception
    {
        try
        {
            GraphComparator.Delta.Command cmd = fromName(null);