### Question:
KunderaPersistenceUnitUtil implements PersistenceUnitUtil { @Override public boolean isLoaded(Object entity, String attributeName) { LoadState state = PersistenceUtilHelper.isLoadedWithoutReference(entity, attributeName, this.cache); if (state == LoadState.LOADED) { return true; } if (state == LoadState.NOT_LOADED) { return false; } return (PersistenceUtilHelper.isLoadedWithReference(entity, attributeName, this.cache) != LoadState.NOT_LOADED); } KunderaPersistenceUnitUtil(PersistenceUtilHelper.MetadataCache cache); @Override boolean isLoaded(Object entity, String attributeName); @Override boolean isLoaded(Object entity); @Override Object getIdentifier(Object entity);  }### Answer:
@Test public void testIsLoaded() { PersistenceUnitUtil utils = emf.getPersistenceUnitUtil(); Assert.assertNotNull(utils); Assert.assertFalse(utils.isLoaded(null)); }
@Test public void testIsLoadedWithoutReference() { PersistenceUnitUtil utils = emf.getPersistenceUnitUtil(); Person p = new Person(); p.setAge(32); p.setPersonId("1"); Assert.assertNotNull(utils); Assert.assertTrue(utils.isLoaded(p, "personId")); Assert.assertFalse(utils.isLoaded(null, "personName")); }