Very minor point, but this could probably be tightened to:

```java
if (o instanceof Number) {
     return ((Number) o).intValue();
} else {
     throw new IllegalArgumentException("Don't know how to convert " + o + " + to int");
}
```