import org.gradle.api.internal.artifacts.version.LatestVersionSemanticComparator;
<BUG>import org.gradle.api.specs.Spec;
import org.gradle.util.CollectionUtils;</BUG>
import java.util.*;
public class DependencyResultSorter {
<BUG>public static Collection<DependencyResult> sort(Collection<DependencyResult> input) {
final Set<ModuleVersionSelector> uniqueRequested = new HashSet<ModuleVersionSelector>();
List<DependencyResult> out = CollectionUtils.filter(input, new LinkedList<DependencyResult>(), new Spec<DependencyResult>() {
public boolean isSatisfiedBy(DependencyResult element) {
return uniqueRequested.add(element.getRequested());
}
});</BUG>
Collections.sort(out, new DependencyComparator());

import org.gradle.api.internal.artifacts.version.LatestVersionSemanticComparator;
import java.util.*;
public class DependencyResultSorter {
public static Collection<DependencyResult> sort(Collection<DependencyResult> input) {
List<DependencyResult> out = new ArrayList<DependencyResult>(input);
Collections.sort(out, new DependencyComparator());
return out;
