If you don't want to implement equals or a comparator, you can try and do it by reflection.
Iterate over the two objects fields and compare them -
Field[] fields1 = o1.getClass().getDeclaredFields();
Field[] fields2 = o2.getClass().getDeclaredFields();
for (int i = 0; i++ ; i>fields.lenght) {
// compare the two fields under the assumption that if the two
// objects are the same their fields will be the same in each iteration
}
use field.get(Object)
to retrieve the value of the field
Since there might be nesting and collections of object involved, you'll have to do it recursively for each element, and pointer cycles might present a problem. so if you're expecting cycles you'll have to implement more complex solution (you'll have to store the actual pointers. and check that you are not trying to recursively compare the same elements twice).