public static @NotNull Map<Integer, Void> getTrigramsAsMap(@NotNull CharSequence text) {
    return new AbstractMap<Integer, Void>() {
      final IntSet trigrams = getTrigrams(text);

      @Override
      public int size() {
        return trigrams.size();
      }

      @Override
      public boolean containsKey(Object k) {
        //noinspection deprecation
        return trigrams.contains(k);
      }

      @Override
      public boolean containsValue(Object v) {
        return v == null && !isEmpty();
      }

      @Override
      public void forEach(BiConsumer<? super Integer, ? super Void> consumer) {
        trigrams.forEach(integer -> {
          consumer.accept(integer, null);
        });
      }

      @Override
      public IntSet keySet() {
        return trigrams;
      }

      @Override
      public Collection<Void> values() {
        return Collections.nCopies(trigrams.size(), null);
      }

      @NotNull
      @Override
      public Set<Entry<Integer, Void>> entrySet() {
        return new AbstractSet<Entry<Integer, Void>>() {
          @Override
          public Iterator<Entry<Integer, Void>> iterator() {
            IntIterator iterator = trigrams.iterator();
            return new Iterator<Entry<Integer, Void>>() {
              @Override
              public boolean hasNext() {
                return iterator.hasNext();
              }

              @Override
              public Entry<Integer, Void> next() {
                int key = iterator.nextInt();
                return new AbstractMap.SimpleImmutableEntry<>(key, null);
              }
            };
          }

          @Override
          public int size() {
            return trigrams.size();
          }
        };
      }

      @Override
      public Void get(Object key) {
        return null;
      }
    };
  }
public static @NotNull Map<Integer, Void> getTrigramsAsMap(@NotNull CharSequence text)