private static final String FROM_6 = "Class<? extends FromType>";
public void testGetTo()
{
Mappings mappings1 = new Mappings();
Mapping mapping1 = new Mapping();
mapping1.setTo(TO_1);
mapping1.addFrom(FROM_1);
mapping1.addFrom(FROM_2);
mapping1.addFrom(FROM_3);
mapping1.addFrom(FROM_4);
mappings1.addMapping(mapping1);
TypeMappings typeMappings1 = TypeMappings.getInstance(mappings1);
// make sure the to == from when passing in a mappings1 that don't exist
assertNotNull(typeMappings1.getTo(NOT_MAPPED_1));
assertEquals(NOT_MAPPED_1, typeMappings1.getTo(NOT_MAPPED_1));
assertEquals(typeMappings1.getTo(NOT_MAPPED_2), typeMappings1.getTo(NOT_MAPPED_2));
// make sure we can retrieve the to using a from array.
assertNotNull(typeMappings1.getTo(FROM_1));
assertEquals(TO_1, typeMappings1.getTo(FROM_1));
// make sure we can retrieve the to using a from non array.
assertEquals(TO_1, typeMappings1.getTo(FROM_4));
Mappings mappings2 = new Mappings();
Mapping mapping2 = new Mapping();
mapping2.setTo(TO_2);
mapping2.addFrom(FROM_5);
mappings2.addMapping(mapping2);
TypeMappings typeMappings2 = TypeMappings.getInstance(mappings2);
typeMappings2.setArraySuffix(ARRAY_SUFFIX);
assertEquals(TO_2, typeMappings2.getTo(FROM_5));
assertEquals(TO_2 + ARRAY_SUFFIX, typeMappings2.getTo(FROM_5 + ARRAY_SUFFIX));
Mappings mappings3 = new Mappings();
Mapping mapping3 = new Mapping();
mapping3.setTo(TO_3);
mapping3.addFrom(FROM_6);
mappings3.addMapping(mapping3);
TypeMappings typeMappings3 = TypeMappings.getInstance(mappings3);
// make sure whitespace isn't deleted, only trimmed (Java generics would fail compilation otherwise for example)
assertEquals(
TO_3,