Here you can find the source of newInstanceOrThrow(final Class
private static <T> T newInstanceOrThrow(final Class<T> clazz)
//package com.java2s; //License from project: Apache License public class Main { private static <T> T newInstanceOrThrow(final Class<T> clazz) { try {/*w ww . ja v a2s . com*/ return clazz.newInstance(); } catch (final Exception e) { throw new RuntimeException("Could not instantiate class:" + clazz.getSimpleName(), e); } } }