@Test public void shouldAllowThreeQueryParserReferencesInConstructor() { parsers = new QueryParsers(parser1, parser2, parser3); assertThat(parsers.getLanguages().size(), is(3)); assertThat(parsers.getLanguages().contains(parser1.getLanguage()), is(true)); assertThat(parsers.getLanguages().contains(parser2.getLanguage()), is(true)); assertThat(parsers.getLanguages().contains(parser3.getLanguage()), is(true)); }
public Set<String> getLanguages() { Set<String> result = new HashSet<String>(); for (QueryParser parser : parsers.values()) { result.add(parser.getLanguage()); } return Collections.unmodifiableSet(result); }
QueryParsers { public Set<String> getLanguages() { Set<String> result = new HashSet<String>(); for (QueryParser parser : parsers.values()) { result.add(parser.getLanguage()); } return Collections.unmodifiableSet(result); } }
QueryParsers { public Set<String> getLanguages() { Set<String> result = new HashSet<String>(); for (QueryParser parser : parsers.values()) { result.add(parser.getLanguage()); } return Collections.unmodifiableSet(result); } QueryParsers( QueryParser... parsers );  QueryParsers( Iterable<QueryParser> parsers ); }
QueryParsers { public Set<String> getLanguages() { Set<String> result = new HashSet<String>(); for (QueryParser parser : parsers.values()) { result.add(parser.getLanguage()); } return Collections.unmodifiableSet(result); } QueryParsers( QueryParser... parsers );  QueryParsers( Iterable<QueryParser> parsers ); void addLanguage( QueryParser languageParser ); void addLanguages( QueryParser firstLanguage,
                              QueryParser... additionalLanguages ); void addLanguages( Iterable<QueryParser> languages ); QueryParser removeLanguage( String language ); Collection<QueryParser> removeLanguages( String firstLanguage,
                                                    String... additionalLanguages ); Set<String> getLanguages(); QueryParser getParserFor( String language ); QueryCommand parse( TypeSystem typeSystem,
                               String language,
                               String query ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); }
QueryParsers { public Set<String> getLanguages() { Set<String> result = new HashSet<String>(); for (QueryParser parser : parsers.values()) { result.add(parser.getLanguage()); } return Collections.unmodifiableSet(result); } QueryParsers( QueryParser... parsers );  QueryParsers( Iterable<QueryParser> parsers ); void addLanguage( QueryParser languageParser ); void addLanguages( QueryParser firstLanguage,
                              QueryParser... additionalLanguages ); void addLanguages( Iterable<QueryParser> languages ); QueryParser removeLanguage( String language ); Collection<QueryParser> removeLanguages( String firstLanguage,
                                                    String... additionalLanguages ); Set<String> getLanguages(); QueryParser getParserFor( String language ); QueryCommand parse( TypeSystem typeSystem,
                               String language,
                               String query ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }