### Question:
AsyncProfiler { public static AsyncProfiler getInstance(String profilerLibDirectory) { AsyncProfiler result = AsyncProfiler.instance; if (result != null) { return result; } synchronized (AsyncProfiler.class) { if (instance == null) { try { loadNativeLibrary(profilerLibDirectory); } catch (UnsatisfiedLinkError e) { throw new IllegalStateException(String.format("It is likely that %s is not an executable location. Consider setting " + "the profiling_inferred_spans_lib_directory property to a directory on a partition that allows execution", profilerLibDirectory), e); } instance = new AsyncProfiler(); } return instance; } } private  AsyncProfiler(); static AsyncProfiler getInstance(String profilerLibDirectory); void stop(); String execute(String command); void enableProfilingThread(Thread thread); void disableProfilingThread(Thread thread); void enableProfilingCurrentThread(); void disableProfilingCurrentThread();  }### Answer:
@Test void testShouldCopyLibToTempDirectory() { String defaultTempDirectory = System.getProperty("java.io.tmpdir"); AsyncProfiler.getInstance(defaultTempDirectory); File libDirectory = new File(defaultTempDirectory); File[] libasyncProfilers = libDirectory.listFiles(getLibasyncProfilerFilenameFilter()); assertThat(libasyncProfilers).hasSizeGreaterThanOrEqualTo(1); }
@Test void testShouldCopyLibToSpecifiedDirectory(@TempDir File nonDefaultTempDirectory) { AsyncProfiler.getInstance(nonDefaultTempDirectory.getAbsolutePath()); File[] libasyncProfilers = nonDefaultTempDirectory.listFiles(getLibasyncProfilerFilenameFilter()); assertThat(libasyncProfilers).hasSizeGreaterThanOrEqualTo(1); }