### Question:
LastReadPostHibernateDao extends GenericDao<LastReadPost> implements LastReadPostDao { @Override public LastReadPost getLastReadPost(JCUser forWho, Topic topic) { return (LastReadPost) session().getNamedQuery("getLastReadPostInTopicForUser") .setParameter("topic", topic) .setParameter("user", forWho) .uniqueResult(); } LastReadPostHibernateDao(SessionFactory sessionFactory); @Override @SuppressWarnings("unchecked") List<LastReadPost> getLastReadPostsInTopic(Topic topic); @Override LastReadPost getLastReadPost(JCUser forWho, Topic topic); @Override @SuppressWarnings("unchecked") List<LastReadPost> getLastReadPosts(JCUser forWho, List<Topic> sourceTopics); @Override void deleteLastReadPostsFor(JCUser user);  }### Answer:
@Test public void testGetLastReadPost() { LastReadPost expected = PersistedObjectsFactory.getDefaultLastReadPost(); session.save(expected); LastReadPost actual = lastReadPostDao.getLastReadPost(expected.getUser(), expected.getTopic()); assertEquals(actual.getId(), expected.getId(), "Found incorrect last read post."); }