@Contract("null, _ -> null")
  private static @Nullable <T extends MatchPredicate> T findPredicate(@Nullable MatchPredicate start, @NotNull Class<T> aClass) {
    if (start == null) return null;
    if (aClass.isInstance(start)) return aClass.cast(start);
    if (start instanceof AndPredicate binaryPredicate) {
      final T firstBranchCheck = findPredicate(binaryPredicate.getFirst(), aClass);
      if (firstBranchCheck != null) return firstBranchCheck;
      return findPredicate(binaryPredicate.getSecond(), aClass);
    } else if (start instanceof NotPredicate) {
      return null;
    }
    return null;
  }
@Contract("null, _ -> null")
  private static @Nullable <T extends MatchPredicate> T findPredicate(@Nullable MatchPredicate start, @NotNull Class<T> aClass)