@Override
    public void accept(Point newPoint) {

        updateTimeAndConfirmOrdering(newPoint.time());

        List<SearchResult<Point, Object>> pointsWithinRange = mTree.getAllWithinRange(
            newPoint,
            DISTANCE_THRESHOLD
        );

        //add after search so the "newPoint" isn't in the pointsWithinRange data
        mTree.put(newPoint, null);

        makeAndPublishPairs(pointsWithinRange, newPoint);

        periodicallyPerformCleanUp(newPoint.time());

        sizeHighWaterMark = Math.max(sizeHighWaterMark, this.size());
    }
@Test
    public void testUnorderedPoints() {

        DistanceMetric<Point> metric = new PointDistanceMetric(1.0, 1.0);
        double DISTANCE_THRESHOLD = 1250.0;
        TestSink sink = new TestSink();

        PointPairFinder pairer = new PointPairFinder(Duration.ofSeconds(13), metric, DISTANCE_THRESHOLD, sink);

        Instant time1 = Instant.EPOCH;
        Instant time2 = Instant.EPOCH.minusSeconds(1);

        Point p1 = (new PointBuilder())
            .time(time1).latLong(0.0, 0.0).altitude(Distance.ofFeet(0.0)).build();

        Point p2 = (new PointBuilder())
            .time(time2).latLong(0.0, 0.0).altitude(Distance.ofFeet(0.0)).build();

        pairer.accept(p1);

        assertThrows(
            IllegalArgumentException.class,
            () -> pairer.accept(p2),
            "Fail because input data is not sorted by time"
        );
    }