@Override
  public boolean remove(final Object o) {
    // Two base cases, size==0 and size==1;
    if (!(o instanceof Bytes bytes)) {
      throw new IllegalArgumentException(
          "Expected Bytes, got " + (o == null ? "null" : o.getClass().getName()));
    }
    byte[] array = bytes.toArrayUnsafe();
    if (array.length != byteLength) {
      throw new IllegalArgumentException(
          "Byte array is size " + array.length + " but set is size " + byteLength);
    }
    // Two base cases, size==0 and size==1;
    if (root == null) {
      // size==0 is easy, empty
      return false;
    }
    if (root.leafObject != null) {
      // size==1 just check and possibly remove the root
      if (Arrays.compare(array, root.leafArray) == 0) {
        root = null;
        size--;
        return true;
      } else {
        return false;
      }
    }
    int level = 0;
    Node<E> current = root;
    do {
      int index = array[level] & 0xff;
      Node<E> next = current.children[index];
      if (next == null) {
        return false;
      }
      if (next.leafObject != null) {
        if (Arrays.compare(array, next.leafArray) == 0) {
          // TODO there is no cleanup of empty branches
          current.children[index] = null;
          size--;
          return true;
        } else {
          return false;
        }
      }
      current = next;

      level++;
    } while (true);
  }
Create a BytesTrieSet with a fixed length

@param byteLength length in bytes of the stored types
evm/src/main/java/org/hyperledger/besu/collections/trie/BytesTrieSet.java