### Question:
ImmutableQueryParameter implements Parameter { @Override public <T> List<T> rawValuesAs(Class<? extends T> clazz) { Builder<T> builder = ImmutableList.<T>builder(); for(String rawValue:this.rawValues) { builder.add(ObjectUtil.fromString(clazz,rawValue)); } return builder.build(); } private  ImmutableQueryParameter(String name, ImmutableList<String> rawValues); @Override String name(); @Override boolean isMultivalued(); @Override int cardinality(); @Override String rawValue(); @Override List<String> rawValues(); @Override T rawValueAs(Class<? extends T> clazz); @Override List<T> rawValuesAs(Class<? extends T> clazz); @Override String toString();  }### Answer:
@Test public void transformRawValues$singleValued() { ImmutableQueryParameter parameter = singleValuedParameter(); List<Float> value = parameter.rawValuesAs(Float.class); assertThat(value,contains(3.3f)); }
@Test public void transformRawValues$multiValued() { ImmutableQueryParameter parameter = multiValuedParameter(); List<Integer> value = parameter.rawValuesAs(int.class); assertThat(value,contains(1,2)); }
@Test public void failOnMixedRawValuesTransformation() { ImmutableQueryParameter parameter = mixedParameterValues(); try { parameter.rawValuesAs(Integer.class); fail("Should nor parse a URI as an integer"); } catch (Exception e) { } }
@Test public void transformMixedRawValues() { ImmutableQueryParameter parameter = mixedParameterValues(); try { parameter.rawValuesAs(URI.class); } catch (Exception e) { fail("Should parse an integer as a URI"); } }