@Test
public void testGetDefaultClassLoader() throws Exception {

    final ClassLoader old = Thread.currentThread().getContextClassLoader();
    try (URLClassLoader newCl = new URLClassLoader(new URL[0], getClass().getClassLoader())) {
        Thread.currentThread().setContextClassLoader(newCl);
        assertSame("default classLoader should be same as tccl when set",
                newCl, Util.getDefaultClassLoader());
        Thread.currentThread().setContextClassLoader(null);
        assertSame("default classLoader should be same as Util.class.getClassLoader() when tccl is null",
                Util.class.getClassLoader(), Util.getDefaultClassLoader());
    } finally {
        Thread.currentThread().setContextClassLoader(old);
    }
}