code: public Set<E> getSubSet(int k) {
          int from = -1;
          //TODO: very bad. Bounds should be memorized
          for (int x = 0; x < values.size(); x++) {
              int cIdx = index.get(values.get(x).id());
              if (cIdx == k && from == -1) {
                  from = x;
              }
              if (from >= 0 && cIdx > k) {
                  return new ElementSubSet<>(this, k, from, x);
              }
          }
          if (from >= 0) {
              return new ElementSubSet<>(this, k, from, values.size());
          }
          return Collections.emptySet();
      }
docs: Get a subset for the given partition.
  
  @param k the partition key
  @return the resulting subset. Empty if no elements belong to the given partition.