private static boolean isCompatible(Class[] paramTypes, Class<?>[] actualTypes) {
        if (actualTypes.length != paramTypes.length)
            return false;

        boolean found = true;
        for (int j = 0; j < actualTypes.length; j++) {
            if (!actualTypes[j].isAssignableFrom(paramTypes[j])) {
                if (actualTypes[j].isPrimitive()) {
                    found = primitiveMap.get(actualTypes[j]).equals(paramTypes[j]);
                } else if (paramTypes[j].isPrimitive()) {
                    found = primitiveMap.get(paramTypes[j]).equals(actualTypes[j]);
                }
            }

            if (!found)
                break;
        }

        return found;
    }