### Question:
Utils { public static <T, R extends Type<T>> List<R> typeMap(List<T> input, Class<R> destType) throws TypeMappingException { List<R> result = new ArrayList<R>(input.size()); if (!input.isEmpty()) { try { Constructor<R> constructor = destType.getDeclaredConstructor( input.get(0).getClass()); for (T value : input) { result.add(constructor.newInstance(value)); } } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { throw new TypeMappingException(e); } } return result; } private  Utils(); @SuppressWarnings("unchecked") static List<TypeReference<Type>> convert(List<TypeReference<?>> input); static List<R> typeMap(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); MatcherAssert.assertThat(Utils.typeMap(input, Uint256.class), equalTo(Arrays.asList( new Uint256(BigInteger.ZERO), new Uint256(BigInteger.ONE), new Uint256(BigInteger.TEN)))); }
@Test public void testTypeMapEmpty() { MatcherAssert.assertThat(Utils.typeMap(new ArrayList<BigInteger>(), Uint256.class), equalTo(new ArrayList<Uint256>())); }