Suggestion (TextRange range, CharSequence replacement) { return new Suggestion() { @Override public List<StringOperation> getChanges() { return List.of(StringOperation.replace(range, replacement)); } @Override public String getPresentableText() { return replacement.toString(); } }; }