code: public static List<HBaseConsumerState> create(SortedMap<byte[], byte[]> stateMap) {
      List<HBaseConsumerState> states = new ArrayList<HBaseConsumerState>(stateMap.size());
      for (Map.Entry<byte[], byte[]> entry : stateMap.entrySet()) {
        // Intentionally using HBase Bytes.
        long groupId = Bytes.toLong(entry.getKey());
        int instanceId = Bytes.toInt(entry.getKey(), LONG_BYTES);
        states.add(new HBaseConsumerState(entry.getValue(), groupId, instanceId));
      }
      return states;
    }
docs: Creates a list of {@link HBaseConsumerState} instances based on the given state map.
  @param stateMap
  @return the states