### Question:
PersistenceDelegator { public <E> E findById(final Class<E> entityClass, final Object primaryKey) { E e = find(entityClass, primaryKey); if (e == null) { return null; } return (E) (e); } PersistenceDelegator(final KunderaMetadata kunderaMetadata, final PersistenceCache pc); void persist(Object e); E findById(final Class<E> entityClass, final Object primaryKey); List<E> find(Class<E> entityClass, Object... primaryKeys); List<E> find(Class<E> entityClass, Map<String, String> embeddedColumnMap); void remove(Object e); E merge(E e); void detach(Object entity); Client getClient(EntityMetadata m); Client getClient(final String persistenceUnit); EntityEventDispatcher getEventDispatcher(); boolean isOpen(); void refresh(Object entity); boolean isTransactionInProgress(); PersistenceCache getPersistenceCache(); KunderaMetadata getKunderaMetadata();  }### Answer:
@Test public void testFindById() { PersonnelDTO dto = new PersonnelDTO(); dto.setPersonId("123"); em.persist(dto); try { em.find(null, null); } catch (IllegalArgumentException e) { Assert.assertEquals("PrimaryKey value must not be null for object you want to find.", e.getMessage()); } try { em.find(null, 123); } catch (KunderaException e) { Assert.assertEquals("Invalid class provided " + null, e.getMessage()); } try { em.find(PersonnelDTO.class, null); } catch (IllegalArgumentException e) { Assert.assertEquals("PrimaryKey value must not be null for object you want to find.", e.getMessage()); } try { em.find(PersonnelDTO.class, null); } catch (IllegalArgumentException e) { Assert.assertEquals("PrimaryKey value must not be null for object you want to find.", e.getMessage()); } dto = em.find(PersonnelDTO.class, "123"); Assert.assertNotNull(dto); }