### Question:
AllocationService { public Allocation getAllocationByLmisId(final String allocationID) { return dbUtil.withDao(Allocation.class, new DbUtil.Operation<Allocation, Allocation>() { @Override public Allocation operate(Dao<Allocation, String> dao) throws SQLException { QueryBuilder<Allocation, String> allocationStringQueryBuilder = dao.queryBuilder(); allocationStringQueryBuilder.where().eq("allocationId", allocationID); PreparedQuery<Allocation> query = allocationStringQueryBuilder.prepare(); return dao.queryForFirst(query); } }); } AllocationService(DbUtil dbUtil);  AllocationService(); List<String> getYetToBeReceivedAllocationIds(); List<String> getReceivedAllocationIds(); Allocation getAllocationByLmisId(final String allocationID); void update(Allocation allocation); void syncAllocations(User user); void createAllocation(Allocation allocation); List<Allocation> getYetToBeReceivedAllocations(); List<Allocation> all(); static void clearCache();  }### Answer:
@Test public void shouldGetAllocationByLmisId() throws Exception { String lmisId = "UG-2013"; Allocation firstAllocation = new Allocation(lmisId, "20140901"); firstAllocation.setReceived(false); allocationDao.create(firstAllocation); assertThat(allocationService.getAllocationByLmisId(lmisId).getAllocationId(), is(lmisId)); }