OverpassQueryBuilderImpl implements OverpassQueryBuilder { @Override public OverpassQueryBuilder multipleValues(String name, Set<String> values) { StringBuilder joiner = new StringBuilder(); for (String value : values) { joiner.append(value); joiner.append("|"); } joiner.setLength(joiner.length() - 1); return paramRel(name, "~", joiner.toString()); } OverpassQueryBuilderImpl(); @Override OverpassQueryBuilder append(String statement); @Override OverpassQueryBuilder boundingBox(double lat1, double lon1, double lat2, double lon2); @Override OverpassQueryBuilder around(double radius); @Override OverpassQueryBuilder around(double radius, double lat, double lon); @Override OverpassQueryBuilder setting(String name, String value); @Override OverpassQueryBuilder standaloneParam(String name); @Override OverpassQueryBuilder clause(String name, String value); @Override OverpassQueryBuilder equals(String name, String value); @Override OverpassQueryBuilder notEquals(String name, String value); @Override OverpassQueryBuilder regexMatches(String name, String value); @Override OverpassQueryBuilder regexDoesntMatch(String name, String value); @Override OverpassQueryBuilder multipleValues(String name, Set<String> values); @Override String build();  }
@Test public void testMultipleValues() throws Exception { queryBuilder.multipleValues("foo", new HashSet<>(Arrays.asList("bar", "baz"))); assertThat(queryBuilder.build(), anyOf( equalTo("[\"foo\"~\"bar|baz\"]"), equalTo("[\"foo\"~\"baz|bar\"]")) ); }