### Question:
BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private  BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Class<?> clazz, Predicate<Method> predicate); static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate); static Field getDeclaredField(Class<?> clazz, String name); static Field getField(Class<?> clazz, String name); @CheckForNull static Object getValueFromField(Object object, String name); @CheckForNull static Object getValueFromField(Object object, Field field); static String getPropertyName(Method method); static String getPropertyName(Type returnType, String methodName); static final String GET_PREFIX; static final String SET_PREFIX; static final String IS_PREFIX; }### Answer:
@Test public void testGetPropertyName_String_Void() { assertThat(BeanUtils.getPropertyName(Void.TYPE, "getFoo"), is("getFoo")); assertThat(BeanUtils.getPropertyName(Void.TYPE, "isFoo"), is("isFoo")); assertThat(BeanUtils.getPropertyName(Void.TYPE, "foo"), is("foo")); }
@Test public void testGetPropertyName_String_Get() { assertThat(BeanUtils.getPropertyName(String.class, "getFoo"), is("foo")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "getFoo"), is("foo")); }
@Test public void testGetPropertyName_String_Is() { assertThat(BeanUtils.getPropertyName(String.class, "isFoo"), is("foo")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "isFoo"), is("foo")); }
@Test public void testGetPropertyName_String_FullName() { assertThat(BeanUtils.getPropertyName(String.class, "fooBar"), is("fooBar")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "fooBar"), is("fooBar")); }