The problem is that you are calling assertEquals with Long and int , so the compiler cannot determine if you want assertEquals(long, long) (autounboxing Long ) or assertEquals(Object, Object) (autoboxing int ).
To fix this, you need to handle the unboxing or boxing yourself, either by writing this:
assertEquals(3L, interval1.lowerBound().longValue());
or that:
assertEquals(Long.valueOf(3L), interval1.lowerBound());
(By the way, note that I have changed the order of the two arguments for you. assertEquals expects the first argument to be the expected value and the second to the actual value. This does not affect the statement itself, but it does affect the exception message that is thrown when statement fails.)
source share