public HashRange partition(int index, int count) {
        if (count <= 0) {
            throw new IllegalArgumentException("Count must be a strictly positive value");
        }
        if (index < 0 || index >= count) {
            throw new IllegalArgumentException("Index must be between 0 and " + count);
        }
        BigInteger partitionStart = minInclusive.add(size().multiply(valueOf(index)).divide(valueOf(count)));
        BigInteger partitionEnd = minInclusive.add(size().multiply(valueOf(index + 1)).divide(valueOf(count)));
        return new HashRange(partitionStart, partitionEnd);
    }
@Test
    public void partition() {
        HashRange range = HashRange.range(1000, 2000);
        assertEquals(HashRange.range(1000, 1500), range.partition(0, 2));
        assertEquals(HashRange.range(1500, 2000), range.partition(1, 2));

        range = range("0", "170141183460469231731687303715884105728");
        assertEquals(range("0", "14178431955039102644307275309657008810"),
                range.partition(0, 12));
        assertEquals(range("14178431955039102644307275309657008810", "28356863910078205288614550619314017621"),
                range.partition(1, 12));
        assertEquals(range("28356863910078205288614550619314017621", "42535295865117307932921825928971026432"),
                range.partition(2, 12));
        // ...
        assertEquals(range("141784319550391026443072753096570088106", "155962751505430129087380028406227096917"),
                range.partition(10, 12));
        assertEquals(range("155962751505430129087380028406227096917", "170141183460469231731687303715884105728"),
                range.partition(11, 12));
    }