Adaptation of the test due to incompatibility to the sort method from Java's Collections