NativeLibraryLocator { public File find(JniLibrary jniLibrary) throws IOException { if (this.extractDir != null) { return extractToDirectory(jniLibrary, this.extractDir); } File libFile = extractToDefaultTempDirectory(jniLibrary); if (libFile != null) { return libFile; } File buildFile = getBuildDirectory(jniLibrary); logger.warn( "Having panic attack and resorting to depraved hackery by searching build directory for shared library file:"); logger.warn(buildFile.getCanonicalPath()); return loadFromDirectory(jniLibrary, buildFile); } NativeLibraryLocator(String extractDir);  NativeLibraryLocator(); File find(JniLibrary jniLibrary);  }
@Test void testFind() throws IOException { NativeLibraryLocator locator = new NativeLibraryLocator(testTmpDir.getCanonicalPath()); File result = locator.find(getJniLibrary()); assertNotNull(result); assertTrue(result.exists()); }