Flags asFlags() {
    return new Flags() {
      @Override
      public int size() {
        return myLinearGraph.nodesCount();
      }

      @Override
      public boolean get(int index) {
        return myNodeVisibilityById.get(nodeId(index));
      }

      @Override
      public void set(int index, boolean value) {
        myNodeVisibilityById.set(nodeId(index), value);
      }

      @Override
      public void setAll(boolean value) {
        for (int index = 0; index < size(); index++) set(index, value);
      }
    };
  }
Flags asFlags()