equals and hascode tests for set and arraylist