QueryUtils { public static String buildIn(final Set<?> values) { checkArgument(!values.isEmpty(), "At least one value is required"); StringJoiner joiner = new StringJoiner(","); for (Object value : values) { joiner.add(format("'%s'", value.toString())); } return format("[%s]", joiner.toString()); } private  QueryUtils(); static String buildPredicate(String... properties); static String buildIn(final Set<?> values);  }
@Test public void testInPredicate() { assertThat(buildIn(newHashSet("foo", "bar")), anyOf(equalTo("['foo','bar']"), equalTo("['bar','foo']"))); }