Since there are already answers. I am going to publish mine.
Finally I used java.util.List.containsAll(Collection<?>) . I came across this method, so I did not want to post this question.
@jarnbjo I didnโt understand that there is a dimension of power that you can consider!
EDIT
Added sth. to fix power problems.
Collection<Object> a, b; boolean equal = (a.size() == b.size()) && a.containsAll(b);
But that too may fail. If collection a has element x twice, and collection b has element y twice. Then the size is the same, and containsAll() gives true .
source share