1 package com.github.davidmoten.rtree; 2 3 import static org.junit.Assert.assertEquals; 4 5 import java.util.List; 6 7 import org.junit.Test; 8 9 import com.github.davidmoten.guavamini.Lists; 10 import com.github.davidmoten.rtree.geometry.Geometries; 11 import com.github.davidmoten.rtree.geometry.HasGeometry; 12 import com.github.davidmoten.rtree.geometry.ListPair; 13 14 public class SplitterRStarTest { 15 16 @Test 17 public void testGetPairs() { 18 19 int minSize = 2; 20 List<HasGeometry> list = Lists.newArrayList(); 21 list.add(Geometries.point(1, 1).mbr()); 22 list.add(Geometries.point(2, 2).mbr()); 23 list.add(Geometries.point(3, 3).mbr()); 24 list.add(Geometries.point(4, 4).mbr()); 25 list.add(Geometries.point(5, 5).mbr()); 26 List<ListPair<HasGeometry>> pairs = SplitterRStar.getPairs(minSize, list); 27 assertEquals(2, pairs.size()); 28 } 29 }