Avoid NPE when checking for !expect.equals(result)