public static Object getIndexedValue(Object collection, int index) {
        Object result = null;
        if (collection instanceof Object[]) {
            Object[] x = (Object[])collection;
            if (index < x.length) {
                return x[index];
            }
        } else if (collection instanceof Collection) {
            Collection<?> x = (Collection<?>)collection;
            if (index < x.size()) {
                Iterator<?> iter = x.iterator();
                for (int i = 0; i < index; i++) {
                    iter.next();
                }
                result = iter.next();
            }
        }
        return result;
    }
Internal class that provides various mapping utilities used throughout the code base. Only intended for internal use.
core/src/main/java/com/github/dozermapper/core/util/MappingUtils.java