// 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;
        assertEquals("XXXXX", tb.getMyString());

        TestNesting tn = new TestNesting();
        fu.setSimpleValue(tn, "extra", "XTRA");
        assertEquals("XTRA", tn.getExtra());

        fu.setSimpleValue(tn, "extra", null);
        assertEquals(null, tn.getExtra());

        fu.setSimpleValue(tn, "myArray", new String[] {"A1","B2","C3"});
        assertEquals(3, tn.getMyArray().length);
        assertEquals("B2", tn.getMyArray()[1]);

        try {
            fu.setSimpleValue(null, "extra", "XTRA");
            fail("should have thrown exception");
        } catch (IllegalArgumentException e) {
            assertNotNull(e.getMessage());
        }

        try {
            fu.setSimpleValue(tn, null, "XTRA");
            fail("should have thrown exception");
        } catch (IllegalArgumentException e) {
            assertNotNull(e.getMessage());
        }

        try {
            fu.setSimpleValue(tn, "XXXX", null);
            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;

        assertEquals("XXXXX", tb.getMyString());

        TestNesting tn = new TestNesting();
        fu.setSimpleValue(tn, "extra", "XTRA");
        assertEquals("XTRA", tn.getExtra());

        fu.setSimpleValue(tn, "extra", null);
        assertEquals(null, tn.getExtra());

        fu.setSimpleValue(tn, "myArray", new String[] {"A1","B2","C3"});
        assertEquals(3, tn.getMyArray().length);
        assertEquals("B2", tn.getMyArray()[1]);

        try {
            fu.setSimpleValue(null, "extra", "XTRA");
            fail("should have thrown exception");
        } catch (IllegalArgumentException e) {
            assertNotNull(e.getMessage());
        }

        try {
            fu.setSimpleValue(tn, null, "XTRA");
            fail("should have thrown exception");
        } catch (IllegalArgumentException e) {
            assertNotNull(e.getMessage());
        }

        try {
            fu.setSimpleValue(tn, "XXXX", null);
            fail("should have thrown exception");
        } catch (FieldnameNotFoundException e) {