@Override
    public void search(K q, double radius, List<Neighbor<K, V>> neighbors) {
        if (radius <= 0 || radius != (int) radius) {
            throw new IllegalArgumentException("The parameter radius has to be an integer: " + radius);
        }
        
        root.search(q, (int) radius, neighbors);
    }
@Test
    public void testRange() {
        System.out.println("range");
        List<Neighbor<String, String>> n1 = new ArrayList<>();
        List<Neighbor<String, String>> n2 = new ArrayList<>();
        for (int i = 1000; i < 1100; i++) {
            bktree.search(words[i], 1, n1);
            naive.search(words[i], 1, n2);
            /*
            System.out.println(i+" "+words[i]);
            java.util.Collections.sort(n1);
            java.util.Collections.sort(n2);
            System.out.println(n1.stream().map(Objects::toString).collect(Collectors.joining(", ")));
            System.out.println(n2.stream().map(Objects::toString).collect(Collectors.joining(", ")));
             */
            assertEquals(n1.size(), n2.size());
            String[] s1 = new String[n1.size()];
            String[] s2 = new String[n2.size()];
            for (int j = 0; j < s1.length; j++) {
                s1[j] = n1.get(j).value;
                s2[j] = n2.get(j).value;
            }
            Arrays.sort(s1);
            Arrays.sort(s2);
            for (int j = 0; j < s1.length; j++) {
                assertEquals(s1[j], s2[j]);
            }
            n1.clear();
            n2.clear();
        }
    }