@NotNull
  private static List<StandardMethodContract> findContracts(@NotNull PsiMethodImpl method,
                                                            @NotNull MethodData data,
                                                            @NotNull Nullability nullability,
                                                            @NotNull IntPredicate notNullParameter) {
    PsiAnnotation explicitContract = AnnotationUtil.findAnnotationInHierarchy(
      method, Collections.singleton(JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT), true);
    if (explicitContract != null) {
      // Explicit contract may suppress inferred nullability, so parse them
      return JavaMethodContractUtil.parseContracts(method, explicitContract);
    }
    List<PreContract> preContracts = data.getContracts();
    List<StandardMethodContract> contracts;
    try {
      contracts = RecursionManager.doPreventingRecursion(
        method, true, () -> ContainerUtil.concat(preContracts, c -> c.toContracts(method, data.methodBody(method))));
    }
    catch (CannotRestoreExpressionException e) {
      throw ContractInferenceIndexKt.handleInconsistency(method, data, e);
    }
    if (contracts == null || contracts.isEmpty()) return Collections.emptyList();
    if (contracts.size() == 2) {
      StandardMethodContract collapsed = contracts.get(0).tryCollapse(contracts.get(1));
      if (collapsed != null) {
        contracts = Collections.singletonList(collapsed);
      }
    }

    return postProcessContracts(contracts, method, nullability, notNullParameter);
  }
@NotNull
  private static List<StandardMethodContract> findContracts(@NotNull PsiMethodImpl method,
                                                            @NotNull MethodData data,
                                                            @NotNull Nullability nullability,
                                                            @NotNull IntPredicate notNullParameter)