@@ -0,0 +1,1131 @@
+package com.eatthepath.jvptree.util;%0A%0Aimport com.eatthepath.jvptree.DistanceFunction;%0Aimport com.eatthepath.jvptree.IntegerDistanceFunction;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.util.AbstractList;%0Aimport java.util.List;%0Aimport java.util.Random;%0A%0Aimport static org.junit.jupiter.api.Assertions.*;%0A%0Aclass SamplingMedianDistanceThresholdSelectionStrategyTest %7B%0A%0A    private static class FakeGiganticList extends AbstractList%3CInteger%3E %7B%0A%0A        @Override%0A        public Integer get(final int index) %7B%0A            if (index %3E= size() %7C%7C index %3C 0) %7B%0A                throw new IndexOutOfBoundsException();%0A            %7D%0A%0A            return index;%0A        %7D%0A%0A        @Override%0A        public int size() %7B%0A            return 305574400;%0A        %7D%0A    %7D%0A%0A    @Test%0A    void selectThreshold() %7B%0A        final SamplingMedianDistanceThresholdSelectionStrategy%3CInteger, Integer%3E strategy =%0A                new SamplingMedianDistanceThresholdSelectionStrategy%3C%3E();%0A%0A        final List%3CInteger%3E points = new FakeGiganticList();%0A%0A        assertDoesNotThrow(() -%3E strategy.selectThreshold(points, 17, (a, b) -%3E Math.abs(a - b)));%0A    %7D%0A%7D

Add a failing test to demonstrate an index-out-of-bounds issue.