ObjectHelper { public static <T> boolean isTransientId(Class<T> clazz, Field field) { if (!field.getName().endsWith(TRANSIENT_ID_SUFFIX)) { return false; } Method getMethod = ReflectHelper.getGetterMethod(clazz, field); if (getMethod != null && getMethod.getAnnotation(Transient.class) != null) { return true; } return false; }  static boolean isEmpty(Object object); static boolean isTransientId(Class<T> clazz, Field field);  }
@Test public void isTransientId() throws NoSuchFieldException { Assert.assertFalse(ObjectHelper.isTransientId(Bean.class, Bean.class.getDeclaredField("a"))); Assert.assertTrue(ObjectHelper.isTransientId(Bean.class, Bean.class.getDeclaredField("dId"))); Assert.assertFalse(ObjectHelper.isTransientId(Bean.class, Bean.class.getDeclaredField("e"))); }