List<StandardMethodContract> (@NotNull PsiMethod method, @Nullable PsiAnnotation contractAnno) { if (contractAnno == null) return Collections.emptyList(); String text = AnnotationUtil.getStringAttributeValue(contractAnno, null); if (text != null) { try { final int paramCount = method.getParameterList().getParametersCount(); List<StandardMethodContract> parsed = StandardMethodContract.parseContract(text); if (ContainerUtil.and(parsed, c -> c.getParameterCount() == paramCount)) { return parsed; } } catch (StandardMethodContract.ParseException ignored) { } } return Collections.emptyList(); }