### Question:
DownsampleMain { public static void main(String[] args) { try { File input = new File(System.getProperty("input")); File output = new File(System.getProperty("output")); Pattern pattern = Pattern.compile(System.getProperty("pattern")); long intervalMs = Long.parseLong(System.getProperty("ms")); Downsample.downsample(input, output, pattern, intervalMs, TimeUnit.MILLISECONDS) .count().toBlocking().single(); } catch (RuntimeException e) { System.out .println("Usage: -Dinput=<input directory> -Doutput=<output directory> -Dpattern=<filename pattern> -Dms=<downsample interval ms>"); throw e; } }  static void main(String[] args);  }### Answer:
@Test public void test() { String filename = "target/downsample-main-test/123456789.track"; File file = new File(filename); file.getParentFile().mkdirs(); File outFile = new File("target/ds-output/123456789.track"); TestingUtil.writeTwoBinaryFixes(filename, BinaryFixesFormat.WITHOUT_MMSI); setProperty("input", file.getParent()); setProperty("output", outFile.getParent()); setProperty("pattern", ".*.track"); setProperty("ms", "" + TimeUnit.MINUTES.toMillis(500000)); DownsampleMain.main(new String[] {}); assertEquals(1, outFile.getParentFile().list().length); assertEquals(BinaryFixes.recordSize(BinaryFixesFormat.WITHOUT_MMSI), outFile.length()); }