private static TypeName annotatedReturnType ( ExecutableElement method ) { TypeMirror returnType = method . getReturnType ( ) ; List < AnnotationSpec > annotations = returnType . getAnnotationMirrors ( ) . stream ( ) . map ( AnnotationSpec :: get ) . collect ( toList ( ) ) ; return TypeName . get ( returnType ) . annotated ( annotations ) ; }
The return type of the given method including type annotations .