Consider the following if the summaryAccount variable is null in a JPA Criteria Query.
Predicate a= builder.equal(root.get(SummaryAccountProjection_.summaryAccount), summaryAccount));
and
Predicate a= builder.isNull(root.get(SummaryAccountProjection_.summaryAccount));
Will produce different results. Granted the user should have used isNull but this allows a user to shoot themselves in the foot without knowing it. It would be helpful if this ideally threw an exception or at a minimum logged a warning.
Also see: https://gist.github.com/codylerum/6851dd5882b0d306fcea323a7cfe31e0