<pre><code>Double out = otherTypes.someMethod(c, c2);
assertEquals((Double)-1.0D, out);
</code></pre>

<p>I get error "Double cannot be resolved" (the Double in assertEquals), is there any way to hack around it except extracting variable?</p>

<p>Is this bug in Java or just very usefull feature that wont be fix?</p>

My variation is similar to jjnguy's
```
```
assertEquals(Double.valueOf(-1.0D), out)
```
```
This biggest difference is Double.valueOf can returned a cached copy rather than having to create a new object.