Let's say I have a class (the equal method also exists):

`public class SomeClassA { private int a; private int b; @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + a; result = prime * result + b; return result; } } `

And another class:

`public class SomeClassB { List<SomeClassA> firstList; List<SomeClassA> secondList; `

How do I construct the hashcode so that two objects are seen as equals if they have the same objects in firstList and the same objects in secondList.

//Hank

-------------Problems Reply------------

` public int hashCode() {`

final int prime = 31;

int result = 1;

result = prime * result + firstList.hashCode();

result = prime * result + secondList.hashCode();

return result;

}