DefaultParameterNameProvider implements ParameterNameProvider { public String[] parameterNamesFor(AccessibleObject method) { Type[] parameterTypes = parameterTypes(method); String[] names = new String[parameterTypes.length]; for (int i = 0; i < names.length; i++) { names[i] = extractor.nameFor(parameterTypes[i]); } return names; } DefaultParameterNameProvider(TypeNameExtractor extractor); String[] parameterNamesFor(AccessibleObject method);  }
@Test public void shouldNameObjectTypeAsItsSimpleName() throws SecurityException, NoSuchMethodException { assertThat(provider.parameterNamesFor(Horse.class.getMethod("runThrough", Field.class))[0], is(equalTo("field"))); }
@Test public void shouldNamePrimitiveTypeAsItsSimpleName() throws SecurityException, NoSuchMethodException { assertThat(provider.parameterNamesFor(Horse.class.getMethod("rest", int.class))[0], is(equalTo("int"))); }
@Test public void shouldNameArrayAsItsSimpleTypeName() throws SecurityException, NoSuchMethodException { assertThat(provider.parameterNamesFor(Horse.class.getMethod("setLeg", int[].class))[0], is(equalTo("intList"))); }
@Test public void shouldNameGenericCollectionUsingOf() throws SecurityException, NoSuchMethodException { assertThat(provider.parameterNamesFor(Cat.class.getDeclaredMethod("fightWith", List.class))[0], is(equalTo("stringList"))); }