### Question:
NetcdfFixesWriter { public static Observable<Integer> convertToNetcdf(File input, File output, Pattern pattern) { return Formats.transform(input, output, pattern, Transformers.<HasFix> identity(), FIXES_TO_NETCDF_WRITER, name -> name.replaceFirst("\\.track(\\.gz)?", ".nc")); }  static void writeFixes(List<HasFix> fixes, File file); static Observable<Integer> convertToNetcdf(File input, File output, Pattern pattern);  }### Answer:
@Test public void testNetcdfConverter() throws IOException, InvalidRangeException { TestingUtil.writeTwoBinaryFixes("target/987654321.track", BinaryFixesFormat.WITHOUT_MMSI); int count = NetcdfFixesWriter.convertToNetcdf(new File("target"), new File("target/nc"), Pattern.compile("987654321.track")).count().toBlocking().single(); assertEquals(1, count); File ncFile = new File("target/nc/987654321.nc"); assertTrue(ncFile.exists()); assertTrue(ncFile.length() > 0); NetcdfFile nc = NetcdfFile.open(ncFile.getCanonicalPath()); List<Attribute> attributes = nc.findGroup(null).getAttributes(); System.out.println(attributes); assertFalse(attributes.isEmpty()); System.out.println(nc.getDimensions()); { Array array = nc.readSection("latitude"); assertEquals(-10f, array.getFloat(0), PRECISION); assertEquals(-10.1f, array.getFloat(1), PRECISION); assertEquals(2, array.getSize()); } { Array array = nc.readSection("longitude"); assertEquals(135f, array.getFloat(0), PRECISION); assertEquals(135.2f, array.getFloat(1), PRECISION); assertEquals(2, array.getSize()); } { Array array = nc.readSection("source"); assertEquals((short) 1, array.getShort(0)); assertEquals((short) 2, array.getShort(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("latency"); assertEquals(12, array.getInt(0)); assertEquals(13, array.getInt(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("navigational_status"); assertEquals(NavigationalStatus.ENGAGED_IN_FISHING.ordinal(), array.getByte(0)); assertEquals(NavigationalStatus.AT_ANCHOR.ordinal(), array.getByte(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("rate_of_turn"); assertEquals(-128, array.getByte(0)); assertEquals(-128, array.getByte(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("speed_over_ground"); assertEquals(75, array.getInt(0)); assertEquals(45, array.getInt(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("course_over_ground"); assertEquals(450, array.getShort(0)); assertEquals(200, array.getShort(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("heading"); assertEquals(46, array.getShort(0)); assertEquals(30, array.getShort(1)); assertEquals(2, array.getSize()); } { Array array = nc.readSection("ais_class"); assertEquals(1, array.getInt(0)); assertEquals(1, array.getInt(1)); assertEquals(2, array.getSize()); } }