### Question:
Annotations { public static Method[] findDeclaredMethodsAnnotatedBy( Class<? extends Annotation> decorator, Class<?> target) { return collectMethodsAnnotatedBy(decorator, Reflects.findAllMethods(target)); } private  Annotations(); static Object findAttributeValueFor(Annotation target, String attribute); static Method[] findMethodsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Class<?> target); static Method[] findDeclaredMethodsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Class<?> target); static Method[] collectMethodsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Method[] methods); static Field[] findFieldsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Class<?> target); static Field[] findDeclaredFieldsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Class<?> target); static Field[] collectFieldsAnnotatedBy(
            Class<? extends Annotation> decorator,
            Field[] fields);  }### Answer:
@Test public void findDeclaredMethodsAnnotatedByテスト正常系1() { Method[] actual = Annotations.findDeclaredMethodsAnnotatedBy( Annotation1.class, AnnotationsTestBean.class); assertNotNull(actual); assertEquals(4, actual.length); List<String> expected = Lists.gen( "method1Annotation1", "method3Annotation1", "method4Annotation1", "method5Annotation1"); for (Method m : actual) { assertTrue(expected.contains(m.getName())); } }
@Test public void findDeclaredMethodsAnnotatedByテスト正常系3() { Method[] actual = Annotations.findDeclaredMethodsAnnotatedBy( Annotation3.class, AnnotationsTestBean.class); assertNotNull(actual); assertEquals(1, actual.length); assertEquals(actual[0].getName(), "method6Annotation3"); }