@Test
  public void testForceNew() {
    ClassLoader rootLoader = Thread.currentThread().getContextClassLoader();
    AddToClassPathAction action1 = new AddToClassPathAction(rootLoader, Arrays.asList("/a/1", "/c/3"));
    UDFClassLoader parentLoader = action1.run();
    AddToClassPathAction action2 = new AddToClassPathAction(parentLoader, Arrays.asList("/b/2", "/d/4"), true);
    UDFClassLoader childLoader = action2.run();
    assertNotSame(
        "When forceNewClassLoader is set, a new instance must be created.",
        parentLoader, childLoader);
    assertURLsMatch(Arrays.asList("file:/b/2", "file:/d/4"), childLoader.getURLs());
  }
Minimal tests for AddToClassPathAction class. Most of the tests don't use
{@link java.security.AccessController#doPrivileged(java.security.PrivilegedAction)},
presumably the tests will not be executed under security manager.
ql/src/test/org/apache/hadoop/hive/ql/exec/TestAddToClassPathAction.java