Java JUnit: The method X is ambiguous for type Y

The method assertEquals(Object, Object) is ambiguous for the type …

What this error means is that you’re passing a double and and Double into a method that has two different signatures: assertEquals(Object, Object) and assertEquals(double, double) both of which could be called, thanks to autoboxing.

To avoid the ambiguity, make sure that you either call assertEquals(Object, Object) (by passing two Doubles) or assertEquals(double, double) (by passing two doubles).

So, in your case, you should use:

assertEquals(Double.valueOf(70), eccen.get("alpha"));

Or:

assertEquals(70.0d, eccen.get("alpha").doubleValue());

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)