@Override
  public boolean tryAcquireJobLock(Configuration conf) {
    Path path = new Path(locksDir, String.format(LOCKS_DIR_JOB_FILENAME, getJobJtIdentifier(conf)));

    return tryCreateFile(conf, path);
  }
@Test
  public void tryAcquireJobLockTest() {
    boolean firstAttempt = tested.tryAcquireJobLock(configuration);
    boolean secondAttempt = tested.tryAcquireJobLock(configuration);
    boolean thirdAttempt = tested.tryAcquireJobLock(configuration);

    assertTrue(isFileExists(getJobLockPath()));

    tested.releaseJobIdLock(configuration);

    boolean fourthAttempt = tested.tryAcquireJobLock(configuration);
    boolean fifthAttempt = tested.tryAcquireJobLock(configuration);

    assertTrue(firstAttempt);
    assertFalse(secondAttempt);
    assertFalse(thirdAttempt);

    assertTrue(fourthAttempt);
    assertFalse(fifthAttempt);
  }