FieldHelper { public static List<EntityField> getFields(Class<?> entityClass) { return fieldHelper.getFields(entityClass); }  static List<EntityField> getFields(Class<?> entityClass); static List<EntityField> getProperties(Class<?> entityClass); static List<EntityField> getAll(Class<?> entityClass);  }
@Test public void testUser(){ List<EntityField> fieldList = FieldHelper.getFields(User.class); Assert.assertEquals(2, fieldList.size()); Assert.assertEquals("id", fieldList.get(0).getName()); Assert.assertEquals("name", fieldList.get(1).getName()); }
@Test public void testComplex(){ List<EntityField> fieldList = FieldHelper.getFields(Admin.class); Assert.assertEquals(2, fieldList.size()); Assert.assertEquals("admin", fieldList.get(0).getName()); Assert.assertEquals("user", fieldList.get(1).getName()); }