### Question:
PersistenceUtilHelper { public static LoadState isLoadedWithoutReference(Object proxy, String property, MetadataCache cache) { if (proxy == null || property == null) { return LoadState.NOT_LOADED; } if (proxy instanceof KunderaProxy) { LazyInitializer li = ((KunderaProxy) proxy).getKunderaLazyInitializer(); if (li.isUninitialized()) { return LoadState.NOT_LOADED; } return LoadState.LOADED; } else { return LoadState.LOADED; } }  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 testisLoadedWithoutReferenceAsNull() { LoadState state = PersistenceUtilHelper.isLoadedWithoutReference(null, null, cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.NOT_LOADED, state); }
@Test public void testisLoadedWithoutReferenceAsLoad() { Person p = new Person(); p.setPersonName("Vivek"); LoadState state = PersistenceUtilHelper.isLoadedWithoutReference(p, "personName", cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.LOADED, state); }
@Test public void testisLoadedWithOutReferenceAsKunderaProxy() 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.isLoadedWithoutReference(proxy, "personName", cache); Assert.assertNotNull(state); Assert.assertEquals(LoadState.NOT_LOADED, state); }