### Question:
AllocationService { public List<String> getReceivedAllocationIds() { return from(queryAllocationsByReceived(true)).transform( new Function<Allocation, String>() { @Override public String apply(Allocation input) { return input.getAllocationId(); } } ).toList(); } 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 getReceivedAllocationIdsShouldGetIdsOfReceivedAllocations() throws Exception { Allocation firstAllocation = new Allocation("UG-2013", "20140901"); firstAllocation.setReceived(false); Allocation secondAllocation = new Allocation("UG-2012", "20140901"); secondAllocation.setReceived(true); allocationDao.create(firstAllocation); allocationDao.create(secondAllocation); assertThat(allocationService.getReceivedAllocationIds(), contains("UG-2012")); assertThat(allocationService.getReceivedAllocationIds(), not(contains("UG-2013"))); }