code: public static BooleanExpression asBoolean(Expression<Boolean> expr) {
          Expression<Boolean> underlyingMixin = ExpressionUtils.extract(expr);
          if (underlyingMixin instanceof PathImpl) {
              return new BooleanPath((PathImpl<Boolean>) underlyingMixin);
          } else if (underlyingMixin instanceof PredicateOperation) {
              return new BooleanOperation((PredicateOperation) underlyingMixin);
          } else if (underlyingMixin instanceof PredicateTemplate) {
              return new BooleanTemplate((PredicateTemplate) underlyingMixin);
          } else {
              return new BooleanExpression(underlyingMixin) {
  
                  private static final long serialVersionUID = -8712299418891960222L;
  
                  @Override
                  public <R, C> R accept(Visitor<R, C> v, C context) {
                      return this.mixin.accept(v, context);
                  }
  
              };
          }
      }
docs: Create a new BooleanExpression
  
  @param expr Expression of type Boolean
  @return new BooleanExpression