### Question:
PersistenceUtilHelper { public static LoadState isLoadedWithReference(Object proxy, String property, MetadataCache cache) { return proxy == null? LoadState.NOT_LOADED:isLoaded(get(proxy, property, cache)); }  static LoadState isLoadedWithReference(Object proxy, String property, MetadataCache cache); static LoadState isLoadedWithoutReference(Object proxy, String property, MetadataCache cache); static LoadState isLoaded(Object o);  }### Answer:
@Test public void testisLoadedWithReferenceAsNull() { LoadState state = PersistenceUtilHelper.isLoadedWithReference(null, null, cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.NOT_LOADED, state); }
@Test public void testisLoadedWithReferenceAsLoaded() { Person p = new Person(); p.setPersonName("Vivek"); LoadState state = PersistenceUtilHelper.isLoadedWithReference(p, "personName", cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.UNKNOWN, state); }
@Test public void testisLoadedWithReferenceAsKunderaProxy() throws NoSuchMethodException, SecurityException { CglibLazyInitializerFactory factory = new CglibLazyInitializerFactory(); KunderaProxy proxy = factory.getProxy("Person", Person.class, Person.class.getDeclaredMethod("getPersonId", null), Person.class.getDeclaredMethod("setPersonId", String.class), "personId", null); LoadState state = PersistenceUtilHelper.isLoadedWithReference(proxy, "personId", cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.UNKNOWN, state); }