Isn't this better as:

```java
if (!command.isElementCommand()) {
  return getErrorResult("Unable to get name without an element.");
}
```