ReflectionHelper { List<SyntheticField> makeSynthetic(Class<?> clazz, List<Field> fields) { List<SyntheticField> result = new ArrayList<>(); for (Field field : fields) { result.add(new AccessorSyntheticField(this, clazz, field)); } return result; }  T newInstance(Class<T> clazz); T newInstance(String className);  }
@Test public void testMakeSynthetic() throws Exception { List<Field> orgFields = new ArrayList<>(); orgFields.add(SimpleExtendedDomain.class.getDeclaredField("b")); orgFields.add(SimpleExtendedDomain.class.getDeclaredField("c")); List<SyntheticField> fields = reflectionHelper.makeSynthetic(SimpleExtendedDomain.class, orgFields); assertThat(fields).hasSize(2); for (SyntheticField sf : fields) { assertThat(sf).isInstanceOf(AccessorSyntheticField.class); } }