@Test public void testAddressGroupAutocomplete() { ReferenceLibrary library = new ReferenceLibrary( ImmutableList.of( ReferenceBook.builder("b1") .setAddressGroups( ImmutableList.of( new AddressGroup(null, "g1"), new AddressGroup(null, "a1"))) .build(), ReferenceBook.builder("b2") .setAddressGroups(ImmutableList.of(new AddressGroup(null, "g2"))) .build())); assertThat( AutoCompleteUtils.autoComplete( "network", "snapshot", Type.ADDRESS_GROUP_NAME, "", 5, null, null, library) .stream() .map(AutocompleteSuggestion::getText) .collect(Collectors.toSet()), equalTo(ImmutableSet.of("g1", "a1", "g2"))); assertThat( AutoCompleteUtils.autoComplete( "network", "snapshot", Type.ADDRESS_GROUP_NAME, "G", 5, null, null, library) .stream() .map(AutocompleteSuggestion::getText) .collect(Collectors.toSet()), equalTo(ImmutableSet.of("g1", "g2"))); assertThat( AutoCompleteUtils.autoComplete( "network", "snapshot", Type.ADDRESS_GROUP_NAME, "g1", 5, null, null, library) .stream() .map(AutocompleteSuggestion::getText) .collect(Collectors.toSet()), equalTo(ImmutableSet.of("g1"))); }
@Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); } }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  @Nonnull static List<AutocompleteSuggestion> autoComplete(
      Variable.Type completionType, String query, int maxSuggestions); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary,
      boolean fuzzyMatching); @Nonnull static List<AutocompleteSuggestion> baseAutoComplete(
      @Nullable String query, Set<String> allProperties); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Set<String> strings); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Map<String, Optional<String>> stringsWithDescriptions); @Nonnull static ImmutableList<AutocompleteSuggestion> ipStringAutoComplete(
      @Nullable String query, Map<Ip, IpCompletionMetadata> ips); }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  @Nonnull static List<AutocompleteSuggestion> autoComplete(
      Variable.Type completionType, String query, int maxSuggestions); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary,
      boolean fuzzyMatching); @Nonnull static List<AutocompleteSuggestion> baseAutoComplete(
      @Nullable String query, Set<String> allProperties); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Set<String> strings); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Map<String, Optional<String>> stringsWithDescriptions); @Nonnull static ImmutableList<AutocompleteSuggestion> ipStringAutoComplete(
      @Nullable String query, Map<Ip, IpCompletionMetadata> ips);  }