public static boolean isCollectionOfType ( TypeName typeName , TypeName elementTypeName ) { return isAssignable ( typeName , Collection . class ) && isEquals ( ( ( ParameterizedTypeName ) typeName ) . typeArguments . get ( 0 ) , elementTypeName ) ; }
Checks if is collection and if element type is the one passed as parameter .