MemoryBackend implements SuggestBackend, Grouped { static Set<String> analyze(final String input) { if (input.isEmpty()) { return ImmutableSet.of(); } final String[] parts = p.split(input); final Set<String> output = new HashSet<>(); for (final String p : parts) { final String l = p.toLowerCase(); if (l.length() == 0) { continue; } output.add(l); output.addAll(prefix(l)); } return output; } @Inject  MemoryBackend(final Groups groups, final AsyncFramework async,
        Integer numSuggestionsIntLimit); @Override AsyncFuture<Void> configure(); @Override AsyncFuture<TagValuesSuggest> tagValuesSuggest(TagValuesSuggest.Request request); @Override AsyncFuture<TagKeyCount> tagKeyCount(final TagKeyCount.Request request); @Override AsyncFuture<TagSuggest> tagSuggest(final TagSuggest.Request request); @Override AsyncFuture<KeySuggest> keySuggest(
            final KeySuggest.Request request); @Override AsyncFuture<TagValueSuggest> tagValueSuggest(
            final TagValueSuggest.Request request); @Override AsyncFuture<WriteSuggest> write(final WriteSuggest.Request request); @Override boolean isReady(); @Override Groups groups(); String toString();  }
@Test public void testAnalyze() { assertEquals( ImmutableSet.of("w", "wo", "wor", "worl", "world", "h", "he", "hel", "hell", "hello"), MemoryBackend.analyze("HelloWorld")); assertEquals(ImmutableSet.of("a", "b"), MemoryBackend.analyze("a-b")); }