Question: In color schemes, I would like to sort the hues, but would like to avoid 'big gaps', i.e. prefer `350,354,2,10,15` over `2,10,15,350,354` (when expressed as 0-360 degree values). What's the best approach of doing that (eg in php)? Is it finding the 'biggest gap' and start after that? Any better ideas?

Answer: 
Unless you specifically want to check only the very first superclass, it would be better to use:

```
return (action instanceof logic.UserBehavior);

```

Your method would be better with this:

```
action.getClass().getSuperClass().name().equals("logic.UserBehavior");

```

The call to `toString()` is not the best idea.

Or better yet, as posted by [Ulrik](https://stackoverflow.com/users/685961/ulrik):

```
action.getClass().getSuperClass() == logic.UserBehavior.class

```
If you want to check only the very first superclass:

```
return action.getClass().getSuperclass() == logic.UserBehavior.class;

```

Otherwise:

```
return (action instanceof logic.UserBehaviour);

```