### Question:
FileLock { public void waitForRelease(@NonNull String filePath) { AtomicInteger lockCount; synchronized (fileLockCountMap) { lockCount = fileLockCountMap.get(filePath); } if (lockCount == null || lockCount.get() <= 0) return; synchronized (waitThreadForFileLockMap) { waitThreadForFileLockMap.put(filePath, Thread.currentThread()); } Util.d(TAG, "waitForRelease start " + filePath); while (true) { if (isNotLocked(lockCount)) break; park(); } Util.d(TAG, "waitForRelease finish " + filePath); } FileLock(@NonNull Map<String, AtomicInteger> fileLockCountMap,
             @NonNull Map<String, Thread> waitThreadForFileLockMap);   FileLock(); void increaseLock(@NonNull String path); void decreaseLock(@NonNull String path); void waitForRelease(@NonNull String filePath);  }### Answer:
@Test public void waitForRelease() { fileLock.waitForRelease(filePath1); verify(fileLock, never()).park(); assertThat(waitThreadForFileLockMap.isEmpty()).isTrue(); fileLockCountMap.put(filePath1, new AtomicInteger(1)); doReturn(false, true).when(fileLock).isNotLocked(any(AtomicInteger.class)); fileLock.waitForRelease(filePath1); assertThat(waitThreadForFileLockMap.get(filePath1)).isEqualTo(Thread.currentThread()); verify(fileLock).park(); }