Ken Jones

Greenhorn
+ Follow
since Oct 17, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ken Jones

While I was copying my code into this reply I found the source of my problem, in an equals() method, of course. Thanks for your help!

Ken
14 years ago
Here is a snippet of the relevant parts of some JUnit code that is puzzling me:

This test passes, but I expect it to fail. I expect the size of the set to be 1 instead of two because I am adding two different objects that are equal to one another. I didn't think the second call to add() would add another member to the set because of this equality. What am I missing?

Thanks,

Ken
14 years ago