code: public static <T> T instantiate(Class<T> clazz) {
  		if (clazz == null) {
  			throw new NullPointerException();
  		}
  		
  		// try to instantiate the class
  		try {
  			return clazz.newInstance();
  		}
  		catch (InstantiationException iex) {
  			// check for the common problem causes
  			checkForInstantiation(clazz);
  			
  			// here we are, if non of the common causes was the problem. then the error was
  			// most likely an exception in the constructor or field initialization
  			throw new RuntimeException("Could not instantiate type '" + clazz.getName() + 
  					"' due to an unspecified exception: " + iex.getMessage(), iex);
  		}
  		catch (IllegalAccessException iaex) {
  			// check for the common problem causes
  			checkForInstantiation(clazz);
  			
  			// here we are, if non of the common causes was the problem. then the error was
  			// most likely an exception in the constructor or field initialization
  			throw new RuntimeException("Could not instantiate type '" + clazz.getName() + 
  					"' due to an unspecified exception: " + iaex.getMessage(), iaex);
  		}
  		catch (Throwable t) {
  			String message = t.getMessage();
  			throw new RuntimeException("Could not instantiate type '" + clazz.getName() + 
  				"' Most likely the constructor (or a member variable initialization) threw an exception" + 
  				(message == null ? "." : ": " + message), t);
  		}
  	}
docs: Creates a new instance of the given class.
  
  @param <T> The generic type of the class.
  @param clazz The class to instantiate.
  
  @return An instance of the given class.
  
  @throws RuntimeException Thrown, if the class could not be instantiated. The exception contains a detailed
  message about the reason why the instantiation failed.