class BinaryTimeTree {

    public CountReport countsInBins(TimeSpan overAllRange, int numberOfBins)
    {
        List<TimeSpan> tsList = overAllRange.subDivide(numberOfBins);
        if (tsList.isEmpty())
        {
            return new CountReport();
        }
        int minBinCount = Integer.MAX_VALUE;
        int maxBinCount = 0;
        int totalCount = 0;
        List<TimeAndCount> resultList = New.list(tsList.size());
        for (TimeSpan span : tsList)
        {
            int count = countInRange(span);
            totalCount += count;
            if (count > maxBinCount)
            {
                maxBinCount = count;
            }
            if (count < minBinCount)
            {
                minBinCount = count;
            }
            resultList.add(new TimeAndCount(span, count));
        }

        return new CountReport(totalCount, minBinCount, maxBinCount, resultList);
    }

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

}