Object (final int i, final Object object) { final Object o = myMethods[i].invoke(object, ArrayUtilRt.EMPTY_OBJECT_ARRAY); if (i == myLastElement) return o; if (o instanceof List) { List<Object> result = new ArrayList<>(); for (Object o1 : (List<?>)o) { result.add(invoke(i + 1, o1)); } return result; } return invoke(i + 1, o); }