Do you think we should change this to:

```java
if (specialty != nul) {
    query.setParameter("specialtyId", specialty.getId());
}
```