public void flushAllTracks() {

        parallelismDetector.run(() -> {
            ArrayList<String> allKnownKeys = newArrayList(tracksUnderConstruction.keySet());
            closeAndPublish(allKnownKeys);
        });
    }
@Test
    public void flushAllTracks() {

        String ONE = "[RH],STARS,D21_B,03/24/2018,14:42:00.130,N518SP,C172,,5256,032,110,186,042.92704,-083.70974,3472,5256,-14.5730,42.8527,1,Y,A,D21,,POL,ARB,1446,ARB,ACT,VFR,,01500,,,,,,S,1,,0,{RH}";
        String TWO = "[RH],STARS,D21_B,03/24/2018,14:42:04.750,N518SP,C172,,5256,032,110,184,042.92457,-083.70999,3472,5256,-14.5847,42.7043,1,Y,A,D21,,POL,ARB,1446,ARB,ACT,VFR,,01500,,,,,,S,1,,0,{RH}";

        //different Track ID (from 3472 to 3473)
        String A = "[RH],STARS,D21_B,03/24/2018,14:42:00.130,N518SP,C172,,5256,032,110,186,042.92704,-083.70974,3473,5256,-14.5730,42.8527,1,Y,A,D21,,POL,ARB,1446,ARB,ACT,VFR,,01500,,,,,,S,1,,0,{RH}";
        String B = "[RH],STARS,D21_B,03/24/2018,14:42:04.750,N518SP,C172,,5256,032,110,184,042.92457,-083.70999,3473,5256,-14.5847,42.7043,1,Y,A,D21,,POL,ARB,1446,ARB,ACT,VFR,,01500,,,,,,S,1,,0,{RH}";

        TestConsumer trackConsumer = new TestConsumer();
        TrackMaker maker = new TrackMaker(trackConsumer);

        maker.accept(NopHit.from(ONE));
        maker.accept(NopHit.from(A));
        maker.accept(NopHit.from(TWO));
        maker.accept(NopHit.from(B));

        maker.flushAllTracks();

        assertEquals(0, maker.currentPointCount());
        assertEquals(0, maker.numTracksUnderConstruction());
        assertEquals(4, maker.numPointsPublished());
        assertEquals(2, maker.numTracksPublished());

        assertEquals(2, trackConsumer.numCallsToAccept);
    }