@Test public void testCreateAspectDefinitionsFor() throws NoSuchMethodException, SecurityException { AnnotatedElement annotatedElement = TestClass.class.getMethod("somethingElse"); List<LinkkiAspectDefinition> definitions = AspectAnnotationReader .createAspectDefinitionsFor(annotatedElement); assertThat(definitions.size(), is(3)); LinkkiAspectDefinition definition = definitions.get(0); assertThat(definition, is(instanceOf(TestAspectDefinition.class))); assertThat(definition, isInitializedWith(TestAnnotation.class)); LinkkiAspectDefinition anotherDefinition = definitions.get(1); assertThat(anotherDefinition, is(instanceOf(AnotherTestAspectDefinition.class))); assertThat(anotherDefinition, isInitializedWith(TestAnnotation.class)); LinkkiAspectDefinition definitionFromSecondAnnotation = definitions.get(2); assertThat(definitionFromSecondAnnotation, is(instanceOf(TestAspectDefinition.class))); assertThat(definitionFromSecondAnnotation, isInitializedWith(AnotherTestAnnotation.class)); }
public static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement) { return getAllAnnotations(annotatedElement) .map(a -> AspectAnnotationReader.createAspectDefinitionsFrom(a)) .flatMap(Collection::stream) .collect(Collectors.toList()); }
AspectAnnotationReader { public static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement) { return getAllAnnotations(annotatedElement) .map(a -> AspectAnnotationReader.createAspectDefinitionsFrom(a)) .flatMap(Collection::stream) .collect(Collectors.toList()); } }
AspectAnnotationReader { public static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement) { return getAllAnnotations(annotatedElement) .map(a -> AspectAnnotationReader.createAspectDefinitionsFrom(a)) .flatMap(Collection::stream) .collect(Collectors.toList()); } private  AspectAnnotationReader(); }
AspectAnnotationReader { public static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement) { return getAllAnnotations(annotatedElement) .map(a -> AspectAnnotationReader.createAspectDefinitionsFrom(a)) .flatMap(Collection::stream) .collect(Collectors.toList()); } private  AspectAnnotationReader(); static List<LinkkiAspectDefinition> createAspectDefinitionsFrom(
            UI_ANNOTATION uiAnnotation); static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement); static List<LinkkiAspectDefinition> createAspectDefinitionsFor(Annotation componentDefAnnotation,
            AnnotatedElement annotatedElement); }
AspectAnnotationReader { public static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement) { return getAllAnnotations(annotatedElement) .map(a -> AspectAnnotationReader.createAspectDefinitionsFrom(a)) .flatMap(Collection::stream) .collect(Collectors.toList()); } private  AspectAnnotationReader(); static List<LinkkiAspectDefinition> createAspectDefinitionsFrom(
            UI_ANNOTATION uiAnnotation); static List<LinkkiAspectDefinition> createAspectDefinitionsFor(AnnotatedElement annotatedElement); static List<LinkkiAspectDefinition> createAspectDefinitionsFor(Annotation componentDefAnnotation,
            AnnotatedElement annotatedElement);  }