### Question:
EntityUtil { public static <T extends BaseEntity> Field getPKField(T entity) { Objects.requireNonNull(entity, "Entity must not be NULL"); Field pkField = null; List<Field> fields = ReflectionUtil.getAllFields(entity.getClass()); for (Field field : fields) { PK idAnnotation = field.getAnnotation(PK.class); if (idAnnotation != null) { pkField = field; } } return pkField; }  static void setDefaultsOnFields(Object entity); static boolean isObjectsDifferent(Object original, Object compare, boolean consumeFieldsOnly); @SuppressWarnings("unchecked") static int compareConsumeFields(Object original, Object compare); static Field getPKField(T entity); static boolean isPKFieldGenerated(T entity); static String getPKFieldValue(T entity); static Object getPKFieldObjectValue(T entity); static void updatePKFieldValue(T entity, String value); static Map<String, Object> findIdField(Class entityClass, Object id); static String getRealClassName(String className);  }### Answer:
@Test public void testGetPKField() throws IllegalArgumentException, IllegalAccessException { System.out.println("getPKField"); Component entity = new Component(); entity.setComponentId("Test"); Field result = EntityUtil.getPKField(entity); result.setAccessible(true); if ("Test".equals(result.get(entity)) == false) { fail("Unable to get Id"); } }