### Question:
ComponentHibernateDao extends GenericDao<Component> implements ComponentDao { @Override public Set<ComponentType> getAvailableTypes() { Set<ComponentType> result = new LinkedHashSet<ComponentType>(); Collections.addAll(result, ComponentType.values()); for (Component current : getAll()) { result.remove(current.getComponentType()); } return result; } ComponentHibernateDao(SessionFactory sessionFactory); @Override List<Component> getAll(); @Override Set<ComponentType> getAvailableTypes(); @Override Component getByType(ComponentType componentType); @Override ComponentBase getBaseComponent(ComponentType componentType);  }### Answer:
@Test public void testGetAvailableTypes() { Set<ComponentType> availableTypes = dao.getAvailableTypes(); assertAllTypesAvailable(availableTypes); }
@Test public void testGetAvailableTypesAfterInsert() { givenForum(); Set<ComponentType> availableTypes = dao.getAvailableTypes(); assertForumUnavailable(availableTypes); }
@Test public void deleteForum() { givenForum(); dao.delete(forum); assertForumDeleted(dao.getAvailableTypes()); }