Fixed a bug in EquivClasses.java where the weakest equivalence relation wasn't being updated

If you reverse the order of the lists, you get the wrong answer.

e.g.:
List<Integer> A = Arrays.asList(6, 3, 5, 1);
List<Integer> B = Arrays.asList(5, 0, 1, 2);

Outputs:
[0, 1, 1, 0, 4, 1, 5]

Instead of:
[0, 1, 1, 0, 4, 1, 1]

This commit fixes that.  The equivalent C++ doesn't have the same problem.