diff --git a/src/main/java/org/mockito/AdditionalMatchers.java b/src/main/java/org/mockito/AdditionalMatchers.java
index 059693bd8e..fa20fbc491 100644
--- a/src/main/java/org/mockito/AdditionalMatchers.java
+++ b/src/main/java/org/mockito/AdditionalMatchers.java
@@ -49,7 +49,7 @@ public class AdditionalMatchers {
* the given value.
* @return null
.
*/
- public static > T geq(Comparable value) {
+ public static > T geq(T value) {
reportMatcher(new GreaterOrEqual(value));
return null;
}
@@ -147,7 +147,7 @@ public static short geq(short value) {
* the given value.
* @return null
.
*/
- public static > T leq(Comparable value) {
+ public static > T leq(T value) {
reportMatcher(new LessOrEqual(value));
return null;
}
@@ -245,7 +245,7 @@ public static short leq(short value) {
* the given value.
* @return null
.
*/
- public static > T gt(Comparable value) {
+ public static > T gt(T value) {
reportMatcher(new GreaterThan(value));
return null;
}
@@ -343,7 +343,7 @@ public static short gt(short value) {
* the given value.
* @return null
.
*/
- public static > T lt(Comparable value) {
+ public static > T lt(T value) {
reportMatcher(new LessThan(value));
return null;
}
@@ -442,7 +442,7 @@ public static short lt(short value) {
* the given value.
* @return null
.
*/
- public static > T cmpEq(Comparable value) {
+ public static > T cmpEq(T value) {
reportMatcher(new CompareEqual(value));
return null;
}
diff --git a/src/main/java/org/mockito/internal/invocation/ArgumentsComparator.java b/src/main/java/org/mockito/internal/invocation/ArgumentsComparator.java
index 2054cff0c2..7999f73ab8 100644
--- a/src/main/java/org/mockito/internal/invocation/ArgumentsComparator.java
+++ b/src/main/java/org/mockito/internal/invocation/ArgumentsComparator.java
@@ -4,12 +4,12 @@
*/
package org.mockito.internal.invocation;
+import java.lang.reflect.Method;
+import java.util.List;
import org.mockito.ArgumentMatcher;
import org.mockito.internal.matchers.VarargMatcher;
import org.mockito.invocation.Invocation;
-import java.util.List;
-
@SuppressWarnings("unchecked")
public class ArgumentsComparator {
public boolean argumentsMatch(InvocationMatcher invocationMatcher, Invocation actual) {
@@ -22,21 +22,24 @@ public boolean argumentsMatch(InvocationMatcher invocationMatcher, Object[] actu
return false;
}
for (int i = 0; i < actualArgs.length; i++) {
- if (!invocationMatcher.getMatchers().get(i).matches(actualArgs[i])) {
+ ArgumentMatcher