1 /* 2 * Copyright (c) 2016 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.stubbing; 6 7 import org.mockito.internal.invocation.InvocationComparator; 8 import org.mockito.stubbing.Stubbing; 9 10 import java.util.Comparator; 11 12 /** 13 * Compares stubbings based on {@link InvocationComparator} 14 */ 15 public class StubbingComparator implements Comparator<Stubbing> { 16 17 private final InvocationComparator invocationComparator = new InvocationComparator(); 18 compare(Stubbing o1, Stubbing o2)19 public int compare(Stubbing o1, Stubbing o2) { 20 return invocationComparator.compare(o1.getInvocation(), o2.getInvocation()); 21 } 22 } 23