### Question:
AddSensorMeasurement { public void addSensorMeasurement(Measurement measurement, MeasurementData data) { if(measurementService.getDetails(measurement.getId()) == null) { measurementService.addMeasurement(measurement); } measurementService.addMeasurementData(measurement.getId(), data); }  void addSensorMeasurement(Measurement measurement, MeasurementData data);  }### Answer:
@Test public void testAddSensorMeasurement() { UUID id = UUID.randomUUID(); String resource, metric, unit, monitor; resource = "localhost"; metric = "cpu"; unit = "%"; monitor = "mon1"; measurement = new Measurement(id, resource, metric, unit, monitor); data = new MeasurementData(1000000, 1.0); uut.addSensorMeasurement(measurement, data); Assert.assertNotNull((uut.measurementService.getDetails(measurement.getId()))); Assert.assertTrue(uut.measurementService.getDetails(measurement.getId()).getMetric().equals(metric)); }