// Path: src/main/java/org/azeckoski/reflectutils/exceptions/FieldSetValueException.java
// public class FieldSetValueException extends RuntimeException {
// 
//    /**
//     * the field name we were trying to set 
//     */
//    public String fieldName;
//    /**
//     * the value we were trying to set on the field
//     */
//    public Object fieldvalue;
//    /**
//     * the object with the field we were trying to set
//     */
//    public Object object;
// 
//    public FieldSetValueException(String fieldName, Object fieldvalue, Object object, Throwable cause) {
//       super("Failed to set field ("+fieldName+") to value ("+fieldvalue+"), cause=" + cause, cause);
//       this.fieldName = fieldName;
//       this.fieldvalue = fieldvalue;
//       this.object = object;
//    }
//    public FieldSetValueException(String message, String fieldName,
//          Object fieldvalue, Object object, Throwable cause) {
//       super(message, cause);
//       this.fieldName = fieldName;
//       this.fieldvalue = fieldvalue;
//       this.object = object;
//    }
//    
// }
// 
// Path: src/main/java/org/azeckoski/reflectutils/exceptions/FieldnameNotFoundException.java
// public class FieldnameNotFoundException extends RuntimeException {
// 
//    public String fieldName;
// 
//    public FieldnameNotFoundException(String fieldName) {
//       this(fieldName, null);
//    }
// 
//    public FieldnameNotFoundException(String fieldName, Throwable cause) {
//       this("Could not find fieldName ("+fieldName+") on object", fieldName, cause);
//    }
// 
//    public FieldnameNotFoundException(String message, String fieldName, Throwable cause) {
//       super(message, cause);
//       this.fieldName = fieldName;
//    }
// 
// }


import junit.framework.TestCase;
import org.azeckoski.reflectutils.classes.*;
import org.azeckoski.reflectutils.exceptions.FieldSetValueException;
import org.azeckoski.reflectutils.exceptions.FieldnameNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
        }

        // test setting map values
        Map<String, Integer> myMap = new HashMap<String, Integer>();
        myMap.put("A", 10);
        myMap.put("B", 2);
        myMap.put("C", 24);
        fu.setFieldValue(myMap, "A", "alpha");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("alpha", myMap.get("A"));

        fu.setFieldValue(myMap, "(B)", "beta");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("beta", myMap.get("B"));

        fu.setFieldValue(myMap, "D", "delta");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("delta", myMap.get("D"));
    }

    public void testSetNoConvert() {
        FieldUtils fu = new FieldUtils();

        TestNesting tn = new TestNesting(8, "AZ", new String[] {"1", "B", "three"});
        fu.setFieldValue(tn, "id", 88, false);
        assertEquals(88, tn.getId());

        try {
            fu.setFieldValue(tn, "id", "888", false);
            fail("should have thrown exception");
// Path: src/main/java/org/azeckoski/reflectutils/exceptions/FieldSetValueException.java
// public class FieldSetValueException extends RuntimeException {
// 
//    /**
//     * the field name we were trying to set 
//     */
//    public String fieldName;
//    /**
//     * the value we were trying to set on the field
//     */
//    public Object fieldvalue;
//    /**
//     * the object with the field we were trying to set
//     */
//    public Object object;
// 
//    public FieldSetValueException(String fieldName, Object fieldvalue, Object object, Throwable cause) {
//       super("Failed to set field ("+fieldName+") to value ("+fieldvalue+"), cause=" + cause, cause);
//       this.fieldName = fieldName;
//       this.fieldvalue = fieldvalue;
//       this.object = object;
//    }
//    public FieldSetValueException(String message, String fieldName,
//          Object fieldvalue, Object object, Throwable cause) {
//       super(message, cause);
//       this.fieldName = fieldName;
//       this.fieldvalue = fieldvalue;
//       this.object = object;
//    }
//    
// }
// 
// Path: src/main/java/org/azeckoski/reflectutils/exceptions/FieldnameNotFoundException.java
// public class FieldnameNotFoundException extends RuntimeException {
// 
//    public String fieldName;
// 
//    public FieldnameNotFoundException(String fieldName) {
//       this(fieldName, null);
//    }
// 
//    public FieldnameNotFoundException(String fieldName, Throwable cause) {
//       this("Could not find fieldName ("+fieldName+") on object", fieldName, cause);
//    }
// 
//    public FieldnameNotFoundException(String message, String fieldName, Throwable cause) {
//       super(message, cause);
//       this.fieldName = fieldName;
//    }
// 
// }


// Path: src/test/java/org/azeckoski/reflectutils/FieldUtilsTest.java
import junit.framework.TestCase;
import org.azeckoski.reflectutils.classes.*;
import org.azeckoski.reflectutils.exceptions.FieldSetValueException;
import org.azeckoski.reflectutils.exceptions.FieldnameNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

        }

        // test setting map values
        Map<String, Integer> myMap = new HashMap<String, Integer>();
        myMap.put("A", 10);
        myMap.put("B", 2);
        myMap.put("C", 24);
        fu.setFieldValue(myMap, "A", "alpha");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("alpha", myMap.get("A"));

        fu.setFieldValue(myMap, "(B)", "beta");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("beta", myMap.get("B"));

        fu.setFieldValue(myMap, "D", "delta");
        //noinspection AssertEqualsBetweenInconvertibleTypes
        assertEquals("delta", myMap.get("D"));
    }

    public void testSetNoConvert() {
        FieldUtils fu = new FieldUtils();

        TestNesting tn = new TestNesting(8, "AZ", new String[] {"1", "B", "three"});
        fu.setFieldValue(tn, "id", 88, false);
        assertEquals(88, tn.getId());

        try {
            fu.setFieldValue(tn, "id", "888", false);
            fail("should have thrown exception");
        } catch (FieldSetValueException e) {