Your getScore() returns Double
, not double
. Therefore compiler is confused: Should it convert both arguments to Object, or if it should convert only the Double to double?
double a = 2.0;
Double b = 2.0;
// assertEquals(a,b); // fails to compile
// the compiler is confused whether to use
assertEquals((Object) a,(Object) b); // OK
// or
assertEquals(a,(double) b); // OK
Anyway, I would set the method to return primitive type double.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…