CollectionParameterValue extends AbstractParameterValue { @Override public String getQueryString() { return values.stream().map(ParameterValue::getQueryString).collect(Collectors.joining(",")); } CollectionParameterValue(List<ParameterValue> values); @Override Object getValue(); @Override String getQueryString();  }
@Test void getQueryStringReturnsQueryStringRepresentationsOfIndividualElementsJoinedByComma() { final CollectionParameterValue sut = new CollectionParameterValue(Arrays.asList(V_ONE, V_TWO, V_THREE)); assertEquals( Stream.of(V_ONE, V_TWO, V_THREE).map(ParameterValue::getQueryString).collect(Collectors.joining(",")), sut.getQueryString()); }