public synchronized void unlock() throws IOException {
        LOGGER.trace("Releasing lock on {}", file.getAbsolutePath());
        if (flock != null) {
            flock.release();
        }
    }
@Test
    void testUnlock() throws IOException {
        File tempFile = TestUtils.tempFile();
        FileLock lock1 = new FileLock(tempFile);
        try {
            lock1.lock();
            lock1.unlock();
            lock1.lock();
            lock1.unlock();

            assertTrue(lock1.tryLock());
            lock1.unlock();
            assertTrue(lock1.tryLock());
            lock1.unlock();

            FileLock lock2 = new FileLock(tempFile);
            assertTrue(lock2.tryLock());
            lock2.unlock();
            assertDoesNotThrow(lock2::lock);
            lock2.unlock();
        } finally {
            lock1.destroy();
        }
    }