My code is currently working using the query below and I am converting the query to JPA Specification. This is what I have done so far which is working but in an unclean manner. How do I improve this code so in the future it can accept more criteria without going through so many null checks like this? Thanks! Answer