class ByteIndex implements Index {

  private final Byte2ObjectAVLTreeMap<IntArrayList> index;

  /** Constructs an index for the given column */
  public ByteIndex(BooleanColumn column) {
    Preconditions.checkArgument(
        column.type().equals(ColumnType.BOOLEAN), "Byte indexing only allowed on BOOLEAN columns");
    int sizeEstimate = Integer.min(1_000_000, column.size() / 100);
    Byte2ObjectOpenHashMap<IntArrayList> tempMap = new Byte2ObjectOpenHashMap<>(sizeEstimate);
    for (int i = 0; i < column.size(); i++) {
      byte value = column.getByte(i);
      IntArrayList recordIds = tempMap.get(value);
      if (recordIds == null) {
        recordIds = new IntArrayList();
        recordIds.add(i);
        tempMap.trim();
        tempMap.put(value, recordIds);
      } else {
        recordIds.add(i);
      }
    }
    index = new Byte2ObjectAVLTreeMap<>(tempMap);
  }

  private static void addAllToSelection(IntArrayList tableKeys, Selection selection) {
    for (int i : tableKeys) {
      selection.add(i);
    }
  }

  /**
   * Returns a bitmap containing row numbers of all cells matching the given int
   *
   * @param value This is a 'key' from the index perspective, meaning it is a value from the
   *     standpoint of the column
   */
  public Selection get(byte value) {
    Selection selection = new BitmapBackedSelection();
    IntArrayList list = index.get(value);
    if (list != null) {
      addAllToSelection(list, selection);
    }
    return selection;
  }

  /** Returns a {@link Selection} of all values at least as large as the given value */
  public Selection atLeast(byte value) {
    Selection selection = new BitmapBackedSelection();
    Byte2ObjectSortedMap<IntArrayList> tail = index.tailMap(value);
    for (IntArrayList keys : tail.values()) {
      addAllToSelection(keys, selection);
    }
    return selection;
  }

  /** Returns a {@link Selection} of all values greater than the given value */
  public Selection greaterThan(byte value) {<FILL_FUNCTION_BODY>}

  /** Returns a {@link Selection} of all values at most as large as the given value */
  public Selection atMost(byte value) {
    Selection selection = new BitmapBackedSelection();
    Byte2ObjectSortedMap<IntArrayList> head =
        index.headMap((byte) (value + 1)); // we add 1 to get values equal to the arg
    for (IntArrayList keys : head.values()) {
      addAllToSelection(keys, selection);
    }
    return selection;
  }

  /** Returns a {@link Selection} of all values less than the given value */
  public Selection lessThan(byte value) {
    Selection selection = new BitmapBackedSelection();
    Byte2ObjectSortedMap<IntArrayList> head =
        index.headMap(value); // we add 1 to get values equal to the arg
    for (IntArrayList keys : head.values()) {
      addAllToSelection(keys, selection);
    }
    return selection;
  }
}

    Selection selection = new BitmapBackedSelection();
    Byte2ObjectSortedMap<IntArrayList> tail = index.tailMap((byte) (value + 1));
    for (IntArrayList keys : tail.values()) {
      addAllToSelection(keys, selection);
    }
    return selection;
  
<no_super_class>