### Question:
ReflectionHelper { public static String propertyNameOfGetter(Method method) { Preconditions.checkNotNull(method); String name = method.getName(); for (String prefix : GETTER_PREFIXES) { if (name.startsWith(prefix)) { return Introspector.decapitalize(name.substring(prefix.length())); } } throw new IllegalStateException("Method is malformed " + method.getName()); }  static boolean hasAnnotation(Method method, Class<A> annotationType); @Nullable static A findAnnotation(Method method, Class<A> annotationType); @Nullable static A findAnnotation(Class<?> clazz, Class<A> annotationType); @Nullable static Object invokeMethod(Method method, Object target); static Set<Method> getterMethods(Class<?> clazz); static String propertyNameOfGetter(Method method); @Nullable static T propertyValueByName(Object targetObject, String propertyName, Class<T> clazz); @Nullable static Method propertyGetter(Object obj, String propertyName);  }### Answer:
@Test public void testPropetyNameOfGetter() { assertEquals("var", ReflectionHelper.propertyNameOfGetter(childAgetVar)); assertEquals("var2", ReflectionHelper.propertyNameOfGetter(childAisVar2)); }
@Test(expected = IllegalStateException.class) public void testPropertyNameOfGetterBadName() { ReflectionHelper.propertyNameOfGetter(childABar); }