This always gives an assertion error because, 'cust' is a reference type and the assertion is comparing the memory locations and therefore failing each time. During testing the Object sent has the same values for attribute but as it is a different object it has a different memory location.
Which is the best way to get past this problem ? Thanks.
The default matcher used by EasyMock is eq(). It calls equals. If this doesn't work for you, you need to use your own matcher. One easy way is to make a comparator suiting your needs and give it to the cmpEq(Comparable<T>) matcher.