}
@SuppressWarnings("unchecked")
@Test
public void shouldConvertCommaSeparatedValuesOfSpecificNumberTypes() throws ParseException, IntrospectionException {
ParameterConverter converter = new NumberListConverter(NumberFormat.getInstance(Locale.ENGLISH), ",");
Type doublesType = SomeSteps.methodFor("aMethodWithListOfDoubles").getGenericParameterTypes()[0];
List<Double> doubles = (List<Double>) converter.convertValue("3, 0.5, 0.0, 8.00, "+NAN+","+INFINITY, doublesType);
assertThat(doubles.get(0), equalTo(3.0d));
assertThat(doubles.get(1), equalTo(0.5d));
assertThat(doubles.get(2), equalTo(0.0d));
assertThat(doubles.get(3), equalTo(8.00d));
assertThat(doubles.get(4), equalTo(Double.NaN));
assertThat(doubles.get(5), equalTo(Double.POSITIVE_INFINITY));
Type floatsType = SomeSteps.methodFor("aMethodWithListOfFloats").getGenericParameterTypes()[0];
List<Float> floats = (List<Float>) converter.convertValue("3, 0.5, 0.0, 8.00, "+NAN+", -"+INFINITY, floatsType);
assertThat(floats.get(0), equalTo(3.0f));
assertThat(floats.get(1), equalTo(0.5f));
assertThat(floats.get(2), equalTo(0.0f));
assertThat(floats.get(3), equalTo(8.00f));
assertThat(floats.get(4), equalTo(Float.NaN));
assertThat(floats.get(5), equalTo(Float.NEGATIVE_INFINITY));
Type longsType = SomeSteps.methodFor("aMethodWithListOfLongs").getGenericParameterTypes()[0];
List<Long> longs = (List<Long>) converter.convertValue("3, 0, 8", longsType);
assertThat(longs.get(0), equalTo(3L));
assertThat(longs.get(1), equalTo(0L));
assertThat(longs.get(2), equalTo(8L));
Type intsType = SomeSteps.methodFor("aMethodWithListOfIntegers").getGenericParameterTypes()[0];
List<Integer> ints = (List<Integer>) converter.convertValue("3, 0, 8", intsType);
assertThat(ints.get(0), equalTo(3));
assertThat(ints.get(1), equalTo(0));
assertThat(ints.get(2), equalTo(8));
}