code: private Monitor getMonitorJustAcquired(List<ThreadLock.Monitor> monitors) {
          if (monitors.isEmpty()) return null;
          Monitor monitor = monitors.get(0);
          if (monitor.getDepth() != 0) return null;
  
          for (Monitor duplicateCandidate: monitors) {
              if (monitor.equals(duplicateCandidate)) continue; // skip first - equality includes monitor depth
  
              if (monitor.getLock().equals(duplicateCandidate.getLock())) return null; // Acquired earlier
          }
  
          return monitor;
      }
docs: get monitor acquired on current stackframe, null when it was acquired earlier or not monitor is held