### Question:
MatchupGenerator extends BasicTool { static InsituObservation createInsituObservation(SamplingPoint p, DataFile insituDatafile) { final InsituObservation insituObservation = new InsituObservation(); insituObservation.setName(p.getDatasetName()); insituObservation.setDatafile(insituDatafile); insituObservation.setRecordNo(p.getIndex()); insituObservation.setSensor(Constants.SENSOR_NAME_HISTORY); final PGgeometry insituLocation = GeometryUtil.createPointGeometry(p.getLon(), p.getLat()); insituObservation.setLocation(insituLocation); insituObservation.setTime(new Date(p.getTime())); insituObservation.setTimeRadius(Math.abs(p.getReferenceTime() - p.getTime()) / 1000.0); return insituObservation; } MatchupGenerator(); static void main(String[] args); @Override void initialize();  }### Answer:
@Test public void testCreateInsituObservation() { final SamplingPoint samplingPoint = new SamplingPoint(); samplingPoint.setDatasetName("ds_name"); samplingPoint.setIndex(45); samplingPoint.setLon(33.89); samplingPoint.setLat(-11.88); samplingPoint.setTime(889834759837L); samplingPoint.setReferenceTime(889835759837L); final DataFile dataFile = new DataFile(); final InsituObservation observation = MatchupGenerator.createInsituObservation(samplingPoint, dataFile); assertNotNull(observation); assertEquals(samplingPoint.getDatasetName(), observation.getName()); assertSame(dataFile, observation.getDatafile()); assertEquals(samplingPoint.getIndex(), observation.getRecordNo()); assertEquals(Constants.SENSOR_NAME_HISTORY, observation.getSensor()); final PGgeometry location = observation.getLocation(); assertNotNull(location); final Geometry geometry = location.getGeometry(); final Point firstPoint = geometry.getFirstPoint(); assertEquals(samplingPoint.getLat(), firstPoint.getY(), 1e-8); assertEquals(samplingPoint.getLon(), firstPoint.getX(), 1e-8); assertEquals(samplingPoint.getTime(), observation.getTime().getTime()); assertEquals(1000.0, observation.getTimeRadius(), 1e-8); }