### Question:
BinaryTimeTree { public int countInRange(TimeSpan range) { return myTopNode.countInRange(range); } 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(expected = NullPointerException.class) public void testCountInRangeEmptyNode() { assertEquals(0, myTestObject.countInRange(TimeSpan.ZERO)); }
@Test public void testCountInRange() { TimeSpan span1 = new TimeSpanLongLong(0, 1); TimeSpan span2 = new TimeSpanLongLong(1, 2); 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)); assertEquals(1, myTestObject.countInRange(span1)); }