code: private void checkList(List<FileLockReference> list, long position, long size)
          throws OverlappingFileLockException
      {
          assert Thread.holdsLock(list);
          for (FileLockReference ref: list) {
              FileLock fl = ref.get();
              if (fl != null && fl.overlaps(position, size))
                  throw new OverlappingFileLockException();
          }
      }
docs: Check for overlapping file locks