docs: private final void checkHeartbeat(boolean withCreateNewFile)
      throws LockFile.FileSecurityException,
             LockFile.LockHeldExternallyException,
             LockFile.UnexpectedEndOfFileException,
             LockFile.UnexpectedFileIOException,
             LockFile.UnexpectedFileNotFoundException,
             LockFile.WrongLengthException, LockFile.WrongMagicException {
  
          long now;
          long lastHeartbeat;
          long length = 0;
  
          try {
              if (withCreateNewFile) {
                  try {
                      file.createNewFile();
  
                      return;
                  } catch (IOException ioe) {}
              }
  
              if (!file.exists()) {
                  return;
              }
  
              length = file.length();
          } catch (SecurityException se) {
              throw new FileSecurityException(this, "checkHeartbeat", se);
          }
  
          if (length != USED_REGION) {
              throw new WrongLengthException(this, "checkHeartbeat", length);
          }
  
          // Compute the current wall clock time *first* to reduce possibility
          // of unwanted time dilation effects introduced, for example,
          // by intervening thread or process context switches under CPU
          // bursts.
          //
          // Example:
          //
          // Say currentTimeMillis is actually somewhere in (-0.5 and 0.5]
          // and another LockFile concurrently writes a 0-valued heartbeat
          // timestamp.
          //
          // Then, if readHeartbeat comes first here, happens to 'win the race
          // condition' (reads the previous heartbeat: -10,000) and an intervening
          // switch causes greater than ~0.5 millisecond elapsed time to
          // be experienced between readHeartbeat and currentTimeMillis, then
          // currentTimeMillis will be computed as n (n > 0), and (now -
          // lastHearbeat) will be HEARTBEAT_INTERVAL + n, instead of
          // HEARTBEAT_INTERVAL.
          //
          // Now, let n be greater than (HEARTBEAT_INTERVAL_PADDED -
          // HEARTBEAT_INTERVAL).
          //
          // Then the check will succeed, although it should fail.
          //
          // On the other hand, if currentTimeMillis is computed first, the
          // worst than can happen is a false positive indication that
          // the read heartbeat timestamp value was written by a live LockFile
          // instance.
          //
          now           = System.currentTimeMillis();
          lastHeartbeat = readHeartbeat();
  
          // Using padded interval to further reduce corner case effects,
          // now that heartbeat polling is in effect.
          //
          // Basically, it is absolutely essential to fail when a lock really is
          // still held elsewhere, so it is OK to fail on corner cases where
          // the last written heartbeat is very close to HEARTBEAT_INTERVAL
          // in the past and it is possible that timing jitters make it uncertain
          // whether the lock really is still held.
          if (Math.abs(now - lastHeartbeat) <= (HEARTBEAT_INTERVAL_PADDED)) {
              throw new LockHeldExternallyException(this, "checkHeartbeat", now,
                                                    lastHeartbeat);
          }
      }