private PsiAnnotation @NotNull [] toPsi(EKey primaryKey, MethodAnnotations methodAnnotations) {
    boolean notNull = methodAnnotations.notNulls.contains(primaryKey);
    boolean nullable = methodAnnotations.nullables.contains(primaryKey);
    MutationSignature mutationSignature = methodAnnotations.mutates;
    Map<String, String> annotationParameters = new LinkedHashMap<>();
    String contractValues = methodAnnotations.contractsValues.getOrDefault(primaryKey, "");
    if (!contractValues.isEmpty()) {
      annotationParameters.put("value", "\"" + contractValues + '"');
    }
    if (mutationSignature.isPure()) {
      annotationParameters.put("pure", "true");
    }
    else if (mutationSignature != MutationSignature.unknown()) {
      annotationParameters.put("mutates", "\"" + mutationSignature + '"');
    }

    String contractPsiText = generateAnnotationAttributesText(annotationParameters);

    PsiAnnotation psiAnnotation = contractPsiText == null ? null : createContractAnnotation(contractPsiText);

    if (notNull && psiAnnotation != null) {
      return new PsiAnnotation[]{getNotNullAnnotation(), psiAnnotation};
    }
    if (nullable && psiAnnotation != null) {
      return new PsiAnnotation[]{getNullableAnnotation(), psiAnnotation};
    }
    if (notNull) {
      return new PsiAnnotation[]{getNotNullAnnotation()};
    }
    if (nullable) {
      return new PsiAnnotation[]{getNullableAnnotation()};
    }
    if (psiAnnotation != null) {
      return new PsiAnnotation[]{psiAnnotation};
    }
    return PsiAnnotation.EMPTY_ARRAY;
  }
private PsiAnnotation @NotNull [] toPsi(EKey primaryKey, MethodAnnotations methodAnnotations)