private static @Nullable ValueConstraint constraintFromMatcher(PsiExpression expr, boolean negate) {
    if (!(expr instanceof PsiMethodCallExpression call)) return null;
    String calledName = call.getMethodExpression().getReferenceName();
    PsiExpression[] args = call.getArgumentList().getExpressions();
    if (calledName == null) return null;
    return switch (calledName) {
      case "array", "arrayWithSize", "arrayContaining", "arrayContainingInAnyOrder", "contains", "containsInAnyOrder", "containsString",
        "endsWith", "startsWith", "stringContainsInOrder", "empty", "emptyArray", "emptyCollectionOf", "emptyIterable", "emptyIterableOf",
        "hasEntry", "hasItem", "hasItems", "hasKey", "hasProperty", "hasSize", "hasToString", "hasValue", "hasXPath" ->
        negate ? null : NULL_VALUE;
      case "notNullValue" -> negate ? NOT_NULL_VALUE : NULL_VALUE;
      case "nullValue" -> negate ? NULL_VALUE : NOT_NULL_VALUE;
      case "equalTo" -> {
        if (args.length == 1) {
          yield constraintFromLiteral(args[0], negate);
        }
        yield null;
      }
      case "not" -> {
        if (args.length == 1) {
          yield constraintFromMatcher(args[0], !negate);
        }
        yield null;
      }
      case "is" -> {
        if (args.length == 1) {
          ValueConstraint fromMatcher = constraintFromMatcher(args[0], negate);
          yield fromMatcher == null ? constraintFromLiteral(args[0], negate) : fromMatcher;
        }
        yield null;
      }
      default -> null;
    };
  }
private static @Nullable ValueConstraint constraintFromMatcher(PsiExpression expr, boolean negate)