```java
return permission1 == null ? permission2 == null : permission1.equals(permission2);
```