AbstractRangeTree implements RangeTree<C> { @Override public int count(final C location) { return count(Range.singleton(location)); }  @Override boolean isEmpty(); @Override boolean contains(final C location); @Override int count(final C location); @Override Iterable<Range<C>> query(final C location); @Override int count(final Range<C> query); @Override boolean intersects(final Range<C> query); @Override Iterable<Set<Range<C>>> intersect(final Iterable<Range<C>> query); @Override boolean intersects(final Iterable<Range<C>> query);  }
@Test public void testCountEmpty() { assertEquals(0, create(empty).count(0)); }
@Test public void testCountSingletonMiss() { assertEquals(0, create(singleton).count(0)); }
@Test public void testCountSingletonHit() { assertEquals(1, create(singleton).count(1)); }
@Test public void testCountDense() { assertEquals(5, create(dense).count(4)); }
@Test public void testCountSparse() { assertEquals(1, create(sparse).count(4)); }
@Test(expected=NullPointerException.class) public void testCountNullRange() { create(sparse).count((Range<Integer>) null); }
@Test public void testCountEmptyEmptyRange() { assertEquals(0, create(empty).count(empty)); }
@Test public void testCountEmptySingletonRange() { assertEquals(0, create(empty).count(singleton)); }
@Test public void testCountEmptyClosedRange() { assertEquals(0, create(empty).count(closed)); }
@Test public void testCountEmptyOpenRange() { assertEquals(0, create(empty).count(open)); }
@Test public void testCountEmptyClosedOpenRange() { assertEquals(0, create(empty).count(closedOpen)); }
@Test public void testCountEmptyOpenClosedRange() { assertEquals(0, create(empty).count(openClosed)); }
@Test public void testCountSingletonEmptyRange() { assertEquals(0, create(singleton).count(empty)); }
@Test public void testCountSingletonSingletonRangeMiss() { assertEquals(0, create(singleton).count(miss)); }
@Test public void testCountSingletonSingletonRangeHit() { assertEquals(1, create(singleton).count(singleton)); }
@Test public void testCountSingletonClosedRange() { assertEquals(1, create(singleton).count(closed)); }
@Test public void testCountSingletonOpenRange() { assertEquals(0, create(singleton).count(open)); }
@Test public void testCountSingletonClosedOpenRange() { assertEquals(1, create(singleton).count(closedOpen)); }
@Test public void testCountSingletonOpenClosedRange() { assertEquals(0, create(singleton).count(openClosed)); }
@Test public void testCountSparseEmptyRange() { assertEquals(0, create(sparse).count(empty)); }
@Test public void testCountSparseSingletonRangeMiss() { assertEquals(0, create(sparse).count(miss)); }
@Test public void testCountSparseSingletonRangeHit() { assertEquals(1, create(sparse).count(singleton)); }
@Test public void testCountSparseClosedRange() { assertEquals(2, create(sparse).count(closed)); }
@Test public void testCountSparseOpenRange() { assertEquals(1, create(sparse).count(open)); }
@Test public void testCountSparseClosedOpenRange() { assertEquals(1, create(sparse).count(closedOpen)); }
@Test public void testCountSparseOpenClosedRange() { assertEquals(2, create(sparse).count(openClosed)); }
@Test public void testCountDenseEmptyRange() { assertEquals(0, create(dense).count(empty)); }
@Test public void testCountDenseSingletonRangeMiss() { assertEquals(0, create(dense).count(miss)); }
@Test public void testCountDenseSingletonRangeHit() { assertEquals(2, create(dense).count(singleton)); }
@Test public void testCountDenseClosedRange() { assertEquals(101, create(dense).count(closed)); }
@Test public void testCountDenseOpenRange() { assertEquals(100, create(dense).count(open)); }
@Test public void testCountDenseClosedOpenRange() { assertEquals(100, create(dense).count(closedOpen)); }
@Test public void testCountDenseOpenClosedRange() { assertEquals(101, create(dense).count(openClosed)); }
@Test public void testCountDuplicateRanges() { assertEquals(4, create(closed, closed, closed, closed).count(closed)); }