Finally looked inside current version of Specification.where() method and rewrite
final var spec = Specification.where(null);
to
Specification<MyClass> spec = (root, query, builder) -> null;
and it works as expected without deprecated warning. Thank you all for your help!