@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 testTrackClosure() {

        Duration TIME_LIMIT = Duration.ofSeconds(5);
        TestConsumer consumer = new TestConsumer();

        TrackMaker maker = new TrackMaker(TIME_LIMIT, consumer);

        assertTrue(
            consumer.numCallsToAccept == 0,
            "The consumer has not been access yet"
        );

        maker.accept(newPoint("track1", Instant.EPOCH));
        maker.accept(newPoint("differentTrack", Instant.EPOCH.plus(TIME_LIMIT.plusSeconds(1))));

        assertTrue(
            consumer.numCallsToAccept == 1,
            "track1 should be closed because the 2nd point is over the TIME_LIMIT"
        );
    }