@Test
  public void testDirectoryAndWildcard() throws Exception {
    String testClassName = "TestClass";
    String dataTestDir = TEST_UTIL.getDataTestDir().toString();
    System.out.println(dataTestDir);
    String localDirContainingJar = ClassLoaderTestHelper.localDirPath(conf);
    ClassLoaderTestHelper.buildJar(dataTestDir, testClassName, null, localDirContainingJar);
    ClassLoader parent = TestCoprocessorClassLoader.class.getClassLoader();
    CoprocessorClassLoader.parentDirLockSet.clear(); // So that clean up can be triggered

    // Directory
    Path testPath = new Path(localDirContainingJar);
    CoprocessorClassLoader coprocessorClassLoader =
      CoprocessorClassLoader.getClassLoader(testPath, parent, "113_1", conf);
    verifyCoprocessorClassLoader(coprocessorClassLoader, testClassName);

    // Wildcard - *.jar
    testPath = new Path(localDirContainingJar, "*.jar");
    coprocessorClassLoader = CoprocessorClassLoader.getClassLoader(testPath, parent, "113_2", conf);
    verifyCoprocessorClassLoader(coprocessorClassLoader, testClassName);

    // Wildcard - *.j*
    testPath = new Path(localDirContainingJar, "*.j*");
    coprocessorClassLoader = CoprocessorClassLoader.getClassLoader(testPath, parent, "113_3", conf);
    verifyCoprocessorClassLoader(coprocessorClassLoader, testClassName);
  }
Test to make sure the lib jar file extracted from a coprocessor jar have the right name.
Otherwise, some existing jar could be override if there are naming conflicts.
hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java