### Question:
Annotations { public static Method[] findMethodsAnnotatedBy( Class<? extends Annotation> decorator, Class<?> target) { return collectMethodsAnnotatedBy(decorator, target.getMethods()); } 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 findMethodsAnnotatedByテスト正常系1() { Method[] actual = Annotations.findMethodsAnnotatedBy(Annotation1.class, AnnotationsTestBean.class); assertNotNull(actual); assertEquals(3, actual.length); List<String> expected = Lists.gen( "method1Annotation1", "method3Annotation1", "method4Annotation1"); for (Method m : actual) { assertTrue(expected.contains(m.getName())); } }
@Test public void findMethodsAnnotatedByテスト正常系2() { Method[] actual = Annotations.findMethodsAnnotatedBy(Annotation2.class, AnnotationsTestBean.class); assertNotNull(actual); assertEquals(1, actual.length); assertEquals(actual[0].getName(), "method2Annotation2"); }
@Test public void findMethodsAnnotatedByテスト正常系3() { Method[] actual = Annotations.findMethodsAnnotatedBy(Annotation3.class, AnnotationsTestBean.class); assertNotNull(actual); assertEquals(0, actual.length); }