Tighten type bounds for assertInstanceOf

This makes it possible to catch checks for completely unrelated types
at compile time. E.g.,

```java
assertInstanceOf("foo", Integer.class)
```

is a compile-time error.