### Question:
GlobalUtils { public static <T> T newInstance(final Class<T> clazz) { try { return clazz.newInstance(); } catch (InstantiationException e) { log.error("Error instantiating", e); } catch (IllegalAccessException e) { log.error("Access exception", e); } return null; } private  GlobalUtils(); static String replacePlaceholders(final String input, final String placeholder, final String replacement); static String readStreamAsText(final InputStream stream); static void populateDirectories(final Path startPath, final List<Path> existing); static StringBuilder readTextFile(final Path path); static void writeToFile(final CharSequence content, final Path path); static String createMethodName(final String name); static String createClassName(final String input); static String getNamespacePrefix(final String fullName); static String getNameAfterPrefix(final String fullName); @SuppressWarnings("HippoHstCallNodeRefreshInspection") static void refreshSession(final Session session, final boolean keepChanges); static Session createSession(); static void cleanupSession(final Session session); static T newInstance(final Class<T> clazz); @SuppressWarnings("unchecked") static T newInstance(final String className); static Class<?> loadCLass(final String clazz); static String decodeUrl(final String url); static String validFileName(final String input); static boolean marshalWriter(final Writer writer, final Document document); @SuppressWarnings("unchecked") static T unmarshalStream(final InputStream stream, final Class<T> clazz);  }### Answer:
@Test public void testNewInstance() throws Exception { String myString = GlobalUtils.newInstance(String.class); assertTrue(myString != null); myString = GlobalUtils.newInstance(String.class.getName()); assertTrue(myString != null); myString = GlobalUtils.newInstance("com.foo.Bar.Baz"); assertTrue(myString == null); myString = GlobalUtils.newInstance(Integer.class.getName()); assertTrue(myString == null); }