docs: @Override
      public Map<Integer, Integer> pGetRanges(int partition) {
          Map<Integer, Integer> ranges = new TreeMap<Integer, Integer>();
          Integer first = null; // start of the very first token on the ring
          Integer start = null; // start of a range
          UnmodifiableIterator<Map.Entry<Integer,Integer>> iter = m_tokensMap.get().entrySet().iterator();
  
          // Iterate through the token map to find the ranges assigned to
          // the given partition
          while (iter.hasNext()) {
              Map.Entry<Integer, Integer> next = iter.next();
              int token = next.getKey();
              int pid = next.getValue();
  
              if (first == null) {
                  first = token;
              }
  
              // if start is not null, there's an open range, now is
              // the time to close it.
              // else there is no open range, keep on going.
              if (start != null) {
                  //Range end is inclusive so do token - 1
                  ranges.put(start, token - 1);
                  start = null;
              }
  
              if (pid == partition) {
                  // if start is null, there's no open range, start one.
                  start = token;
              }
          }
  
          // if there is an open range when we get here
          // It is the last token which implicity ends at the next max value
          if (start != null) {
              assert first != null;
              ranges.put(start, Integer.MAX_VALUE);
          }
  
          return ranges;
      }