This is cleaner:
```java
if (!command.isElementCommand()) {
return getErrorResult("A scrollable view is required for this command.");
}
```