### Question:
BinaryTimeTree { public TIntList countsInRanges(List<TimeSpan> countTimes) { Utilities.checkNull(countTimes, "countTimes"); if (countTimes.isEmpty()) { return new TIntArrayList(0); } TIntList resultList = new TIntArrayList(countTimes.size()); for (TimeSpan span : countTimes) { resultList.add(countInRange(span)); } return resultList; } BinaryTimeTree();  BinaryTimeTree(int maxValuesPerNode, int maxDepth); void clear(); int countInRange(TimeSpan range); CountReport countsInBins(TimeSpan overAllRange, int numberOfBins); TIntList countsInRanges(List<TimeSpan> countTimes); List<E> findInRange(TimeSpan range); boolean insert(E tsProvider); boolean insert(List<E> collection); int internalSize(BTreeNode<E> node); int maxValuesPerNodeInteral(BTreeNode<E> node, int maxValues); int queryMaxValuesPerNode(); int size();  }### Answer:
@Test public void testCountsInRanges() { TimeSpan span1 = new TimeSpanLongLong(0, 100); TimeSpan span2 = new TimeSpanLongLong(0, 50); TimeSpanProvider mock1 = createNiceMock(TimeSpanProvider.class); TimeSpanProvider mock2 = createNiceMock(TimeSpanProvider.class); expect(mock1.getTimeSpan()).andReturn(span1).anyTimes(); expect(mock2.getTimeSpan()).andReturn(span2).anyTimes(); replay(mock1, mock2); myTestObject.insert(Arrays.asList(mock1, mock2)); TIntList list = myTestObject.countsInRanges(Arrays.asList(span1, span2)); assertEquals(2, list.size()); }
@Test public void testCountsInRangesEmpty() { TIntList list = myTestObject.countsInRanges(new ArrayList<>()); assertTrue(list.isEmpty()); }