### Question:
AbstractDAO implements DAO<TInterface> { @Override @SuppressWarnings("unchecked") public TInterface get(UID uid) throws NoResultException { return (TInterface) this.getEntity(uid); }  @Override void beginTransaction(); @Override void rollback(); @Override void setForRollback(); @Override boolean isSetForRollback(); @Override void commit(); @Override void lock(TInterface entity, LockModeType type); @Override boolean isTransactionActive(); @Override @SuppressWarnings("unchecked") TInterface get(UID uid); @Override @SuppressWarnings("unchecked") TInterface create(final TInterface entity); @Override @SuppressWarnings("unchecked") final synchronized TInterface update(final TInterface entity); @Override boolean exists(UID uid);  }### Answer:
@Test public void get() { BaseEntity entity = AbstractDAOTest.abstractDAO.get(AbstractDAOTest.existingObjUid); Assert.assertEquals(entity.getClass(), JPABusinessEntity.class); JPABusinessEntity business = (JPABusinessEntity) entity; Assert.assertEquals(business.getUID(), AbstractDAOTest.existingObjUid); Assert.assertEquals(business.getName(), "Test Business"); }
@Test public void get_noSuchUid() { this.expectedException.expect(NoResultException.class); AbstractDAOTest.abstractDAO.get(AbstractDAOTest.nonExistingObjUid); }
@Test public void get_inactive() { this.expectedException.expect(NoResultException.class); AbstractDAOTest.abstractDAO.get(AbstractDAOTest.inactiveObjUid); }