@Test void getCompletionSourceEmptyAnalysisResult() { assertThat( completion.getCompletionSource( new MyDocumentModel( "", AnalysisResult.builder().constantDefinitions(Map.of()).build())), is(empty())); }
@Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document) { return ofNullable(document) .map(MyDocumentModel::getAnalysisResult) .map(AnalysisResult::getConstants) .orElse(Set.of()); }
ConstantCompletion implements Completion { @Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document) { return ofNullable(document) .map(MyDocumentModel::getAnalysisResult) .map(AnalysisResult::getConstants) .orElse(Set.of()); } }
ConstantCompletion implements Completion { @Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document) { return ofNullable(document) .map(MyDocumentModel::getAnalysisResult) .map(AnalysisResult::getConstants) .orElse(Set.of()); }  }
ConstantCompletion implements Completion { @Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document) { return ofNullable(document) .map(MyDocumentModel::getAnalysisResult) .map(AnalysisResult::getConstants) .orElse(Set.of()); }  @Nonnull @Override Collection<String> getCompletionSource(MyDocumentModel document); @Nonnull @Override String getSortOrderPrefix(); @Nonnull @Override CompletionItemKind getKind(); }
ConstantCompletion implements Completion { @Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document) { return ofNullable(document) .map(MyDocumentModel::getAnalysisResult) .map(AnalysisResult::getConstants) .orElse(Set.of()); }  @Nonnull @Override Collection<String> getCompletionSource(MyDocumentModel document); @Nonnull @Override String getSortOrderPrefix(); @Nonnull @Override CompletionItemKind getKind();  }