}
@Test
public void testGeneralMappingPassByReference() throws Exception {
// Map
TestObject to = testDataFactory.getInputGeneralMappingTestObject();
TestObject toClone = (TestObject) SerializationUtils.clone(to);
TestObjectPrime prime = mapper.map(to, TestObjectPrime.class);
mapper.map(prime, to);
// more objects should be added to the clone from the ArrayList
TheFirstSubClass fsc = new TheFirstSubClass();
fsc.setS("s");
toClone.getHintList().add(fsc);
toClone.getHintList().add(fsc);
toClone.getEqualNamedList().add("1value");
toClone.getEqualNamedList().add("2value");
int[] pa = { 0, 1, 2, 3, 4, 0, 1, 2, 3, 4 };
int[] intArray = { 1, 1, 1, 1 };
Integer[] integerArray = { new Integer(1), new Integer(1), new Integer(1), new Integer(1) };
toClone.setAnArray(intArray);
toClone.setArrayForLists(integerArray);
toClone.setPrimArray(pa);
toClone.setBlankDate(null);
toClone.setBlankStringToLong(null);
// since we copy by reference the attribute copyByReference we need to null it out. The clone method above creates
// two versions of it...
// which is incorrect
to.setCopyByReference(null);
toClone.setCopyByReference(null);
to.setCopyByReferenceDeep(null);
toClone.setCopyByReferenceDeep(null);
to.setGlobalCopyByReference(null);
toClone.setGlobalCopyByReference(null);
// null out string array because we get NPE since a NULL value in the String []
to.setStringArrayWithNullValue(null);
toClone.setStringArrayWithNullValue(null);
toClone.setExcludeMeOneWay("excludeMeOneWay");
assertEquals(toClone, to);
}