@Test public void testTypeMapEmpty() { assertThat(typeMap(new ArrayList<BigInteger>(), Uint256.class), equalTo(new ArrayList<Uint256>())); }
public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap( List<List<T>> input, Class<E> outerDestType, Class<R> innerType) { List<E> result = new ArrayList<>(); try { Constructor<E> constructor = outerDestType.getDeclaredConstructor(List.class); for (List<T> ts : input) { E e = constructor.newInstance(typeMap(ts, innerType)); result.add(e); } } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new TypeMappingException(e); } return result; }
Utils { public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap( List<List<T>> input, Class<E> outerDestType, Class<R> innerType) { List<E> result = new ArrayList<>(); try { Constructor<E> constructor = outerDestType.getDeclaredConstructor(List.class); for (List<T> ts : input) { E e = constructor.newInstance(typeMap(ts, innerType)); result.add(e); } } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new TypeMappingException(e); } return result; } }
Utils { public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap( List<List<T>> input, Class<E> outerDestType, Class<R> innerType) { List<E> result = new ArrayList<>(); try { Constructor<E> constructor = outerDestType.getDeclaredConstructor(List.class); for (List<T> ts : input) { E e = constructor.newInstance(typeMap(ts, innerType)); result.add(e); } } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new TypeMappingException(e); } return result; } private  Utils(); }
Utils { public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap( List<List<T>> input, Class<E> outerDestType, Class<R> innerType) { List<E> result = new ArrayList<>(); try { Constructor<E> constructor = outerDestType.getDeclaredConstructor(List.class); for (List<T> ts : input) { E e = constructor.newInstance(typeMap(ts, innerType)); result.add(e); } } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new TypeMappingException(e); } return result; } private  Utils(); @SuppressWarnings("unchecked") static List<TypeReference<Type>> convert(List<TypeReference<?>> input); static List<E> typeMap(
            List<List<T>> input,
            Class<E> outerDestType,
            Class<R> innerType); static List<R> typeMap(List<T> input, Class<R> destType); }
Utils { public static <T, R extends Type<T>, E extends Type<T>> List<E> typeMap( List<List<T>> input, Class<E> outerDestType, Class<R> innerType) { List<E> result = new ArrayList<>(); try { Constructor<E> constructor = outerDestType.getDeclaredConstructor(List.class); for (List<T> ts : input) { E e = constructor.newInstance(typeMap(ts, innerType)); result.add(e); } } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new TypeMappingException(e); } return result; } private  Utils(); @SuppressWarnings("unchecked") static List<TypeReference<Type>> convert(List<TypeReference<?>> input); static List<E> typeMap(
            List<List<T>> input,
            Class<E> outerDestType,
            Class<R> innerType); static List<R> typeMap(List<T> input, Class<R> destType);  }