### Question:
BinaryTimeTree { protected void subDivide(List<E> collection, BTreeNode<E> node) { node.setRange(enlargeTimeRange(collection, node.getRange())); if (collection.size() > myMaxValuesPerNode && node.getLevel() < myMaxDepth) { int mid = collection.size() / 2; List<E> leftCol = new ArrayList<>(); leftCol.addAll(collection.subList(0, mid)); List<E> rightCol = new ArrayList<>(); rightCol.addAll(collection.subList(mid, collection.size())); BTreeNode<E> newNode = new BTreeNode<>(); newNode.setLevel(node.getLevel() + 1); node.getSubNodes().add(newNode); newNode = new BTreeNode<>(); newNode.setLevel(node.getLevel() + 1); node.getSubNodes().add(newNode); BTreeNode<E> leftNode = node.getSubNodes().get(0); BTreeNode<E> rightNode = node.getSubNodes().get(1); subDivide(leftCol, leftNode); subDivide(rightCol, rightNode); } else { node.setValues(collection); } } 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 testSubDivide() { myTestObject = new BinaryTimeTree<>(1, 1); BTreeNode<TimeSpanProvider> node = new BTreeNode<>(); BTreeNode<TimeSpanProvider> subNode1 = new BTreeNode<>(); BTreeNode<TimeSpanProvider> subNode2 = new BTreeNode<>(); BTreeNode<TimeSpanProvider> subNode3 = new BTreeNode<>(); BTreeNode<TimeSpanProvider> subNode4 = new BTreeNode<>(); BTreeNode<TimeSpanProvider> subNode5 = new BTreeNode<>(); subNode1.getValues().add(createMock(TimeSpanProvider.class)); subNode1.getValues().add(createMock(TimeSpanProvider.class)); subNode2.getValues().add(createMock(TimeSpanProvider.class)); subNode2.getValues().add(createMock(TimeSpanProvider.class)); subNode2.getValues().add(createMock(TimeSpanProvider.class)); subNode3.getValues().add(createMock(TimeSpanProvider.class)); subNode3.getValues().add(createMock(TimeSpanProvider.class)); node.setSubNodes(new ArrayList<>(Arrays.asList(subNode1, subNode2, subNode3, subNode4, subNode5))); node.setRange(new TimeSpanLongLong(0, 1000)); TimeSpanProvider provider1 = createMock(TimeSpanProvider.class); TimeSpanProvider provider2 = createMock(TimeSpanProvider.class); TimeSpanLongLong span1 = new TimeSpanLongLong(10, 20); expect(provider1.getTimeSpan()).andReturn(span1).anyTimes(); TimeSpanLongLong span2 = new TimeSpanLongLong(20, 200); expect(provider2.getTimeSpan()).andReturn(span2).anyTimes(); replay(provider1, provider2); List<TimeSpanProvider> values = new ArrayList<>(Arrays.asList(provider1, provider2)); node.setValues(values); myTestObject.subDivide(values, node); assertEquals(7, node.getSubNodes().size()); }