public static DirectoryLock lockForDirectory(File dir, ILogger logger) {
        File lockFile = new File(dir, FILE_NAME);
        FileChannel channel = openChannel(lockFile);
        FileLock lock = acquireLock(lockFile, channel);
        if (logger.isFineEnabled()) {
            logger.fine("Acquired lock on " + lockFile.getAbsolutePath());
        }
        return new DirectoryLock(dir, channel, lock, logger);
    }
@Test
    public void test_lockForDirectory_forNonExistingDir() {
        assertThatThrownBy(() -> lockForDirectory(new File(UuidUtil.newUnsecureUuidString()), logger))
                .isInstanceOf(HazelcastException.class)
                .hasCauseInstanceOf(FileNotFoundException.class);
    }