@Override
    public void accept(Point newPoint) {

        //ensure this method is never called by multiple threads at the same time.
        parallelismDetector.run(
            () -> doAccept(newPoint)
        );
    }
@Test
    public void autoTrackClosureConstructorParameterIsRespected() {

        Duration maxPointDelta = Duration.ofSeconds(30);
        Duration maxTrackAge_small = Duration.ofMinutes(1); //way too small in real life
        Duration maxTrackAge_big = Duration.ofHours(2); //default value

        //5 points from the same flight that span 1m 20sec (manipulated times for testing)
        String p1 = "[RH],Center,ZDV,07-09-2019,02:49:54.000,SWA5423,B737,L,0564,380,414,229,37.3058,-101.8194,638,,,,,ZKC/21,,ZDV,,,,E0256,DEN,,IFR,,638,244060382,BWI,,380//380,,L,1,,,{RH}";
        String p2 = "[RH],Center,ZDV,07-09-2019,02:50:16.000,SWA5423,B737,L,0564,380,415,229,37.2911,-101.8403,638,,,,,ZKC/21,,ZDV,,,,E0256,DEN,,IFR,,638,244060652,BWI,,380//380,,L,1,,,{RH}";
        String p3 = "[RH],Center,ZDV,07-09-2019,02:50:39.000,SWA5423,B737,L,0564,380,415,229,37.2758,-101.8619,638,,,,,ZKC/21,,ZDV,,,,E0256,DEN,,IFR,,638,244060923,BWI,,380//380,,L,1,,,{RH}";
        String p4 = "[RH],Center,ZDV,07-09-2019,02:50:51.000,SWA5423,B737,L,0564,380,414,229,37.2606,-101.8833,638,,,,,ZKC/21,,ZDV,,,,E0256,DEN,,IFR,,638,244061193,BWI,,380//380,,L,1,,,{RH}";
        String p5 = "[RH],Center,ZDV,07-09-2019,02:51:14.000,SWA5423,B737,L,0564,380,414,229,37.2453,-101.9053,638,,,,,ZKC/21,,ZDV,,,,E0256,DEN,,IFR,,638,244061462,BWI,,380//380,,L,1,,,{RH}";

        TestConsumer smallCounter = new TestConsumer();
        TrackMaker smallTrackMaker = new TrackMaker(maxPointDelta, maxTrackAge_small, smallCounter);

        smallTrackMaker.accept(NopHit.from(p1));
        smallTrackMaker.accept(NopHit.from(p2));
        smallTrackMaker.accept(NopHit.from(p3));
        smallTrackMaker.accept(NopHit.from(p4));
        smallTrackMaker.accept(NopHit.from(p5)); //this point should cause the track to be "closeable"

        assertThat(smallCounter.numCallsToAccept, is(1));

        //now do same thing...but with a bigger maxTrackAge
        TestConsumer bigCounter = new TestConsumer();
        TrackMaker bigTrackMaker = new TrackMaker(maxPointDelta, maxTrackAge_big, bigCounter);

        bigTrackMaker.accept(NopHit.from(p1));
        bigTrackMaker.accept(NopHit.from(p2));
        bigTrackMaker.accept(NopHit.from(p3));
        bigTrackMaker.accept(NopHit.from(p4));
        bigTrackMaker.accept(NopHit.from(p5)); //this point should NOT cause the track to be "closeable"

        assertThat(bigCounter.numCallsToAccept, is(0)); //nothing emitted yet
    }