### Question:
SamplingPointIO { @SuppressWarnings("unchecked") public static List<SamplingPoint> read(InputStream inputStream) throws IOException { final ObjectMapper objectMapper = new ObjectMapper(); final SamplingPointList samplingPointList = objectMapper.readValue(inputStream, SamplingPointList.class); return samplingPointList.getSamplingPoints(); }  static void write(List<SamplingPoint> samplingPoints, OutputStream outputStream); @SuppressWarnings("unchecked") static List<SamplingPoint> read(InputStream inputStream);  }### Answer:
@Test public void testReadEmptyStream() throws IOException { final ByteArrayInputStream inputStream = createEmptyListStream(); final List<SamplingPoint> emptyList = SamplingPointIO.read(inputStream); assertNotNull(emptyList); assertEquals(0, emptyList.size()); }
@Test public void testReadSinglePointStream() throws IOException { final ByteArrayInputStream inputStream = createSinglePointStream(); final List<SamplingPoint> list = SamplingPointIO.read(inputStream); assertNotNull(list); assertEquals(1, list.size()); final SamplingPoint point = list.get(0); assertEquals(0.5, point.getRandom(), 0.0); assertEquals(1.0, point.getLon(), 0.0); assertEquals(2.0, point.getLat(), 0.0); assertEquals(1000, point.getTime()); assertEquals(67, point.getReference()); assertEquals(1, point.getIndex()); assertEquals(71, point.getReference2()); assertEquals(17, point.getX()); assertEquals(11, point.getY()); assertEquals(19, point.getInsituReference()); assertEquals(20, point.getReferenceTime()); assertEquals(21.0, point.getReferenceLat(), 1e-8); assertEquals(22.0, point.getReferenceLon(), 1e-8); }