StreamTerminatorUtil { public static <ENTITY> boolean isContainingOnlyFieldPredicate(Predicate<ENTITY> predicate) { if (predicate instanceof FieldPredicate) { final FieldPredicate<ENTITY> fieldPredicate = (FieldPredicate<ENTITY>) predicate; return fieldPredicate.getField().typeMapper().getOrdering() == Ordering.RETAIN || NON_COMPARATIVE_PREDICATES.contains(fieldPredicate.getPredicateType()); } else if (predicate instanceof CombinedPredicate) { return ((CombinedPredicate<ENTITY>) predicate).stream().allMatch(StreamTerminatorUtil::isContainingOnlyFieldPredicate); } return false; } private  StreamTerminatorUtil(); static List<FieldPredicate<ENTITY>> topLevelAndPredicates(T initialPipeline); @SuppressWarnings({"unchecked", "rawtypes"}) static List<FieldPredicate<?>> andPredicates(FilterAction<ENTITY> action); static boolean isContainingOnlyFieldPredicate(Predicate<ENTITY> predicate); static boolean isSortedActionWithFieldPredicate(Action<?, ?> action); static void modifySource(
        final List<FieldPredicate<ENTITY>> predicateBuilders,
        final SqlStreamOptimizerInfo<ENTITY> info,
        final AsynchronousQueryResult<ENTITY> query
    ); static RenderResult renderSqlWhere(
        final DbmsType dbmsType,
        final Function<Field<ENTITY>, String> columnNamer,
        final Function<Field<ENTITY>, Class<?>> columnDbTypeFunction,
        final List<Predicate<ENTITY>> predicates
    );  }
@Test void testIsContainingOnlyFieldPredicateLambda() { assertFalse(isContainingOnlyFieldPredicate(p -> true)); }
@Test void testIsContainingOnlyFieldPredicateSimple() { assertTrue(isContainingOnlyFieldPredicate(ID_GT_0)); }
@Test void testIsContainingOnlyFieldPredicateAnd() { assertTrue(isContainingOnlyFieldPredicate(ID_GT_0_AND_AGE_EQ_2)); }
@Test void testIsContainingOnlyFieldPredicateOr() { assertTrue(isContainingOnlyFieldPredicate(ID_GT_0_AND_AGE_EQ_2)); }
@Test void testIsContainingOnlyFieldPredicateComplex() { assertTrue(isContainingOnlyFieldPredicate(COMPLEX)); }
@Test void testIsContainingOnlyFieldPredicateComplexAndPolluted() { assertFalse(isContainingOnlyFieldPredicate(COMPLEX.and(person -> true))); }