Code Inspection for method signatures

i want to create a custom Code Inspection Rule for IntelliJ IDEA. The rule should check, if a special annotated argument type of a method call is equivalent to the parameter type of the method signature.


public void method(@MyAnnotation String input){

public void method2(){
    String invalid = "";
    method(invalid); // error

    @MyAnnotation String valid = (@MyAnnotation String) "";
    method(valid); // no error

What I tried:

protected static class visitor extends JavaElementVisitor {
    public void visitMethodCallExpression(PsiMethodCallExpression expression) {
      PsiMethod method = expression.resolveMethod();

      //returns no annotations
      PsiAnnotation[] annotations = method.getModifierList().getAnnotations();

      //returns also no annotations
      MethodSignatureBackedByPsiMethod methodSignature = MethodSignatureBackedByPsiMethod.create(method, PsiSubstitutor.EMPTY);
      PsiType[] types = methodSignature.getParameterTypes();
      for (PsiType psiType : types){
        TypeAnnotationProvider provider = psiType.getAnnotationProvider();
        PsiAnnotation[] annotations = provider.getAnnotations();

How can I compare the annotation of the argument type with the annotation of the parameter type of the method?