<p>The code</p>

<pre><code>private SomeClass&lt;Integer&gt; someClass;
someClass = EasyMock.createMock(SomeClass.class);
</code></pre>

<p>gives me a warning "Type safety: The expression of type SomeClass needs unchecked conversion to conform to SomeClass&lt;Integer&gt;".</p>

The two obvious routes are to suppress the warning or mock a subclass.
```
```
private static class SomeClass_Integer extends SomeClass<Integer>();
private SomeClass<Integer> someClass;
...
    someClass = EasyMock.createMock(SomeClass_Integer.class);
```
```
(Disclaimer: Not even attempted to compile this code, nor have I used EasyMock.)