### Question:
SamplingPointIO { public static void write(List<SamplingPoint> samplingPoints, OutputStream outputStream) throws IOException { final SamplingPointList samplingPointList = new SamplingPointList(samplingPoints); final ObjectMapper mapper = new ObjectMapper(); mapper.writeValue(outputStream, samplingPointList); }  static void write(List<SamplingPoint> samplingPoints, OutputStream outputStream); @SuppressWarnings("unchecked") static List<SamplingPoint> read(InputStream inputStream);  }### Answer:
@Test public void testWriteEmptyList() throws IOException { final ByteArrayOutputStream outputStream = createEmptyStream(); final List<SamplingPoint> emptyList = new ArrayList<>(); SamplingPointIO.write(emptyList, outputStream); assertEquals(EMPTY_LIST_STRING, outputStream.toString()); }
@Test public void testWriteSinglePointList() throws IOException { final ByteArrayOutputStream outputStream = createEmptyStream(); final ArrayList<SamplingPoint> list = new ArrayList<>(); createSinglePointList(list); SamplingPointIO.write(list, outputStream); assertEquals(SINGLE_POINT_LIST_STRING, outputStream.toString()); }