### Question:
CcAndInferredLocationServiceImpl implements CcAndInferredLocationService { public List<CcAndInferredLocationRecord> getAllLastKnownRecords() throws Exception { String json = _apiLibrary.getItemsForRequestAsString("last-known", "list"); StringReader reader = new StringReader(json); Type collectionType = new TypeToken<Collection<CcAndInferredLocationRecord>>(){}.getType(); return _jsonTool.readJson(reader, collectionType); }  List<CcAndInferredLocationRecord> getAllLastKnownRecords(); OpsApiLibrary get_apiLibrary(); void set_apiLibrary(OpsApiLibrary _apiLibrary); JsonTool get_jsonTool(); void set_jsonTool(JsonTool _jsonTool);  }### Answer:
@Test public void serviceTest() throws Exception { Transaction t = getSession().beginTransaction(); ArrayList<CcAndInferredLocationRecord> records = (ArrayList<CcAndInferredLocationRecord>) _service.getAllLastKnownRecords(); CcAndInferredLocationRecord record = records.get(0); assertEquals(1, records.size()); assertEquals("77a5b211-086e-11e4-9b1a-123139312bff", record.getUUID()); assertEquals(new Integer(2008), record.getVehicleAgencyId()); assertEquals("2014-07-10T20:12:06.000Z", record.getTimeReported()); assertEquals("2014-07-10T20:12:07.473Z", record.getTimeReceived()); assertEquals("2014-07-10T20:12:07.566Z", record.getArchiveTimeReceived()); assertEquals("648703", record.getOperatorIdDesignator()); assertEquals("44", record.getRouteIdDesignator()); assertEquals("24", record.getRunIdDesignator()); assertEquals(new Integer(8443), record.getDestSignCode()); assertEquals(new BigDecimal(40.675807).setScale(6, RoundingMode.HALF_UP), record.getLatitude()); assertEquals(new BigDecimal(-73.950039).setScale(6, RoundingMode.HALF_UP), record.getLongitude()); assertEquals(new BigDecimal(11.5), record.getSpeed()); assertEquals(new BigDecimal(189.10).setScale(2, RoundingMode.HALF_UP), record.getDirectionDeg()); assertEquals("MTANYCT", record.getAgencyId()); assertEquals(new Integer(9695), record.getVehicleId()); assertEquals("FB", record.getDepotId()); assertEquals("2014-07-10", record.getServiceDate()); assertEquals("B44-24", record.getInferredRunId()); assertEquals(new Integer(8443), record.getInferredDestSignCode()); assertEquals(new BigDecimal(40.675811).setScale(6, RoundingMode.HALF_UP), record.getInferredLatitude()); assertEquals(new BigDecimal(-73.949941).setScale(6, RoundingMode.HALF_UP), record.getInferredLongitude()); assertEquals("IN_PROGRESS", record.getInferredPhase()); assertEquals("blockInf", record.getInferredStatus()); assertEquals(true, record.isInferenceIsFormal()); assertEquals(new Double(17316.347663427005), record.getDistanceAlongBlock()); assertEquals(new Double(2664.283320458455), record.getDistanceAlongTrip()); assertEquals(new Integer(66), record.getScheduleDeviation()); assertEquals("B44-24", record.getAssignedRunId()); t.commit(); }