### Question:
UnassignedVehicleServiceImpl implements UnassignedVehicleService { public NycQueuedInferredLocationBean toNycQueueInferredLocationBean(UnassignedVehicleRecord record){ NycQueuedInferredLocationBean inferredLocationBean = new NycQueuedInferredLocationBean(); AgencyAndId vehicleId = new AgencyAndId(record.getAgencyId(), record.getVehicleId()); inferredLocationBean.setVehicleId(AgencyAndId.convertToString(vehicleId)); inferredLocationBean.setRecordTimestamp(record.getTimeReceived()); inferredLocationBean.setTripId(record.getTripId()); inferredLocationBean.setServiceDate(record.getServiceDate()); inferredLocationBean.setInferredLatitude(record.getLatitude()); inferredLocationBean.setInferredLongitude(record.getLongitude()); inferredLocationBean.setPhase(record.getPhase()); inferredLocationBean.setStatus(record.getStatus()); return inferredLocationBean; }  void setFreshenTimestamps(boolean flag); void setPreserveScheduleDeviation(boolean flag); void setEnforceMatchingTripsForScheduleDeviation(boolean flag); @Autowired void setConfigurationService(ConfigurationService configurationService); @Autowired void setVehicleLocationInferenceService(VehicleLocationInferenceService vehicleLocationInferenceService); @Autowired void setOutputQueueSenderService(OutputQueueSenderService outputQueueSenderService); URL getUrl(); @Override void setUrl(URL url); Integer getMaxActiveVehicleAgeSecs(); void setMaxActiveVehicleAgeSecs(Integer maxActiveVehicleAgeSecs); @PostConstruct @Override void setup(); void setupMapper(); @Override /** * take a raw bus record and convert to UnassignedRecord for testing purposes. */ void enqueueTestRecord(RealtimeEnvelope envelope); @PreDestroy @Override void destroy(); boolean vehicleActive(AgencyAndId vehicleId, long currentTime); NycQueuedInferredLocationBean toNycQueueInferredLocationBean(UnassignedVehicleRecord record);  }### Answer:
@Test public void testInferredLocationBeanCreation(){ UnassignedVehicleRecord record = records[0]; NycQueuedInferredLocationBean inferredLocationBean = service.toNycQueueInferredLocationBean(record); assertEquals(record.getVehicleId(), AgencyAndId.convertFromString(inferredLocationBean.getVehicleId()).getId()); assertEquals(record.getTimeReceived(), inferredLocationBean.getRecordTimestamp()); assertEquals(record.getServiceDate(), inferredLocationBean.getServiceDate()); assertEquals(record.getPhase(), inferredLocationBean.getPhase()); assertEquals(record.getAgencyId(), AgencyAndId.convertFromString(inferredLocationBean.getVehicleId()).getAgencyId()); assertEquals(record.getLatitude(), inferredLocationBean.getInferredLatitude()); assertEquals(record.getLongitude(), inferredLocationBean.getInferredLongitude()); assertEquals(record.getTripId(), inferredLocationBean.getTripId()); assertEquals(record.getStatus(), inferredLocationBean.getStatus()); }
@Test public void testUnassignedVehicleToVLR(){ UnassignedVehicleRecord record = records[0]; NycQueuedInferredLocationBean inferredLocationBean = service.toNycQueueInferredLocationBean(record); VehicleLocationRecord vlr = inferredLocationBean.toVehicleLocationRecord(); assertNotNull(vlr); assertEquals(vlr.getPhase(), EVehiclePhase.SPOOKING); assertTrue(Double.isNaN(vlr.getDistanceAlongBlock())); }