code: public Optional<LockResource> tryLockEdge(Edge edge, LockMode mode) {
      return mEdgeLocks.tryGet(edge, mode);
    }
docs: Attempts to acquire an edge lock.
  
  @param edge the edge to try locking
  @param mode the mode to lock in
  @return either an empty optional, or a lock resource which must be closed to release the lock