EntityManagerImpl implements EntityManager { @Override public <ENTITY> void persist(ENTITY entity) { requireNonNull(entity); managerOf(entity).persist(entity); } EntityManagerImpl(); @ExecuteBefore(RESOLVED) void installManagers(ManagerComponent managerComponent); @Override void persist(ENTITY entity); @Override void update(ENTITY entity); @Override void remove(ENTITY entity);  }
@Test void persist() { assertThrows(NullPointerException.class, () -> instance.persist(null)); assertThrows(IllegalStateException.class, () -> instance.persist(1)); assertDoesNotThrow(() -> instance.persist("string")); }