@Override
    public BigInteger getTokenCountInRange(String startToken, String endToken)
    {
        long start = Long.parseLong(startToken);
        long end = Long.parseLong(endToken);

        if (start == end) {
            if (start == MIN_TOKEN) {
                return TOTAL_TOKEN_COUNT;
            }
            else {
                return ZERO;
            }
        }

        BigInteger result = BigInteger.valueOf(end).subtract(BigInteger.valueOf(start));
        if (end <= start) {
            result = result.add(TOTAL_TOKEN_COUNT);
        }
        return result;
    }
@Test
    public void testGetTokenCountInRange()
    {
        assertEquals(tokenRing.getTokenCountInRange("0", "1"), ONE);
        assertEquals(tokenRing.getTokenCountInRange("-1", "1"), new BigInteger("2"));
        assertEquals(tokenRing.getTokenCountInRange("-100", "100"), new BigInteger("200"));
        assertEquals(tokenRing.getTokenCountInRange("0", "10"), new BigInteger("10"));
        assertEquals(tokenRing.getTokenCountInRange("1", "11"), new BigInteger("10"));
        assertEquals(tokenRing.getTokenCountInRange("0", "0"), ZERO);
        assertEquals(tokenRing.getTokenCountInRange("1", "1"), ZERO);
        assertEquals(tokenRing.getTokenCountInRange(Long.toString(Long.MIN_VALUE), Long.toString(Long.MIN_VALUE)), BigInteger.valueOf(2).pow(64).subtract(ONE));
        assertEquals(tokenRing.getTokenCountInRange("1", "0"), BigInteger.valueOf(2).pow(64).subtract(BigInteger.valueOf(2)));
    }