### Question:
JpaPortalPreferenceRepository implements PortalPreferenceRepository { @Override public int getCountAll() { Query query = manager.createNamedQuery(JpaPortalPreference.COUNT_ALL); Number countResult = (Number) query.getSingleResult(); return countResult.intValue(); }  @Override List<PortalPreference> getAll(); @Override List<PortalPreference> getLimitedList(int offset, int pageSize); @Override int getCountAll(); @Override PortalPreference getByKey(String key); @Override Class<? extends PortalPreference> getType(); @Override PortalPreference get(String id); @Override PortalPreference save(PortalPreference item); @Override void delete(PortalPreference item);  }### Answer:
@Test public void testCountAll(){ int count = repository.getCountAll(); assertTrue(count == 2); }