### Question:
BeanDelegator { public Object createDelegator(Object source) { if (source == null || delegatedClasses == null) { return source; } if (delegatedClasses.containsKey(source.getClass())) { Class<?> apiInterface = delegatedClasses.get(source.getClass()); return createDelegator(source, apiInterface); } return source; } BeanDelegator();  BeanDelegator(Map<Class<?>, Class<?>> delegatedClasses,
                       Map<Enum<?>, Enum<?>> enumConvertionMap); static Object nullable(Object o); static String normalizeName(String name); static Map<String, Object> normalizeFields(Map<String, Object> original); Object createDelegator(Object source); @SuppressWarnings("unchecked") T createDelegator(Object source, Class<T> apiInterface); @SuppressWarnings("unchecked") T createDelegator(Object source, Class<T> apiInterface,
                               Map<String, Object> extraFields); Enum<?> convertEnum(Enum<?> value); void validate(); void validate(Class<?> dataClass, Class<?> interfaceClass); static void validateDelegator(Object o); static Map<Enum<?>, Enum<?>> createDefaultEnumMap(
      Class<? extends Enum<?>> sourceEnum, Class<? extends Enum<?>> targetEnum); static final String NULL; static final ImmutableSet<Class<?>> PRIMITIVE_TYPE_CLASSES; }### Answer:
@Test public void testExtraFields() { TokenData data = new TokenData(); String container = "data"; TokenInter p = beanDelegator.createDelegator(data, TokenInter.class, ImmutableMap.<String, Object>of("container", container)); assertSame(data.getId(), p.getId()); assertSame(container, p.getContainer()); }
@Test public void testExtraFieldsBadCase() { TokenData data = new TokenData(); String container = "data"; TokenInter p = beanDelegator.createDelegator(data, TokenInter.class, ImmutableMap.<String, Object>of("Cont_Ainer", container)); assertSame(data.getId(), p.getId()); assertSame(container, p.getContainer()); }