Since you're comparing strings, this needs to be assert not equal (which I don't think actually exists, so we need to use assertFalse(a.equals(b)) ).