### Question:
Reflection { public static Object defaultValueOf( Class<? extends Annotation> annotationType, String attribute) { try { return annotationType.getMethod(attribute).getDefaultValue(); } catch (Exception ex) { throw reflectionException(ex); } } private  Reflection(); static Class<?> maybeWrap(Class<?> clazz); static Constructor<T> findConstructor(
        Class<T> type,
        Class<?>... parameterTypes); static Constructor<T> findDeclaredConstructor(
        Class<T> type,
        Class<?>... parameterTypes); @SuppressWarnings("unchecked") static Constructor<T> singleAccessibleConstructor(
        Class<T> type); static T instantiate(Class<T> clazz); static T instantiate(Constructor<T> ctor, Object... args); static Set<Type<?>> supertypes(Type<?> bottom); static Object defaultValueOf(
        Class<? extends Annotation> annotationType,
        String attribute); static List<Annotation> allAnnotations(AnnotatedElement e); static List<T> allAnnotationsByType(
        AnnotatedElement e,
        Class<T> type); static Method findMethod(
        Class<?> target,
        String methodName,
        Class<?>... argTypes); static Object invoke(Method method, Object target, Object... args); static Field findField(Class<?> type, String fieldName); static List<Field> allDeclaredFieldsOf(Class<?> type); static void setField(
        Field field,
        Object target,
        Object value,
        boolean suppressProtection); static boolean jdk9OrBetter(); static Method singleAbstractMethodOf(Class<?> rawClass); static boolean isMarkerInterface(Class<?> clazz); static RuntimeException reflectionException(Exception ex); static List<AnnotatedType> annotatedComponentTypes(
        AnnotatedType annotatedType);  }### Answer:
@Test public void findingDefaultValueOfAnnotationAttribute() throws Exception { assertEquals("baz", defaultValueOf(Foo.class, "bar")); }
@Test public void missingAnnotationAttribute() throws Exception { thrown.expect(ReflectionException.class); thrown.expectMessage(NoSuchMethodException.class.getName()); defaultValueOf(Foo.class, "noneSuch"); }