@NotNull
    @Override
    public Set<IdIndexEntry> keySet() {
      return new AbstractSet<>() {
        @Override
        public boolean contains(Object o) {
          return o instanceof IdIndexEntry entry && myOccurrences.containsKey(entry.getWordHashCode());
        }

        @Override
        public Iterator<IdIndexEntry> iterator() {
          return new Iterator<>() {
            final IntIterator myIterator = myOccurrences.keySet().iterator();

            @Override
            public boolean hasNext() {
              return myIterator.hasNext();
            }

            @Override
            public IdIndexEntry next() {
              return new IdIndexEntry(myIterator.nextInt());
            }
          };
        }

        @Override
        public int size() {
          return myOccurrences.size();
        }
      };
    }
@NotNull
    @Override
    public Set<IdIndexEntry> keySet()