### Question:
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); static List<R> typeMap1(List<T> input, Class<R> destType);  }### Answer:
@Test public void testTypeMap() throws Exception { final List<BigInteger> input = Arrays.asList( BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN); assertThat(typeMap(input, Uint256.class), equalTo(Arrays.asList( new Uint256(BigInteger.ZERO), new Uint256(BigInteger.ONE), new Uint256(BigInteger.TEN)))); }
@Test public void testTypeMapNested() { List<BigInteger> innerList1 = Arrays.asList(BigInteger.valueOf(1), BigInteger.valueOf(2)); List<BigInteger> innerList2 = Arrays.asList(BigInteger.valueOf(3), BigInteger.valueOf(4)); final List<List<BigInteger>> input = Arrays.asList(innerList1, innerList2); StaticArray2<Uint256> staticArray1 = new StaticArray2<>(new Uint256(1), new Uint256(2)); StaticArray2<Uint256> staticArray2 = new StaticArray2<>(new Uint256(3), new Uint256(4)); List<StaticArray2<Uint256>> expectedList = Arrays.asList(staticArray1, staticArray2); assertThat(typeMap(input, StaticArray2.class, Uint256.class), equalTo(expectedList)); }
@Test public void testTypeMapEmpty() { assertThat(typeMap(new ArrayList<BigInteger>(), Uint256.class), equalTo(new ArrayList<Uint256>())); }