@Override
    public boolean valueIsCompatibleWith(Invocation invocation) {
        if (invocation.getMock().getUid() != proxy.getUid()) {
            return false;
        }

        if (!invocation.getMethod().getName().equals(method.getName())) {
            return false;
        }

        // Be careful! args can be null (case of void methods).
        if (invocation.getArgs() == null) {
            return expectedArguments.isEmpty();
        } else if (expectedArguments.size() != invocation.getArgs().length) {
            return false;
        } else {
            Object[] arguments = invocation.getArgs();
            for (int index = 0; index < arguments.length; index++) {
                Checker<Object> currentChecker = expectedArguments.get(index);
                if (!currentChecker.valueIsCompatibleWith(arguments[index])) {
                    return false;
                }
            }
        }

        return true;
    }