class 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);
        }
    }

    public  BinaryTimeTree();
    public  BinaryTimeTree(int maxValuesPerNode, int maxDepth);

}