docs: public static Object replaceIfNotAtTopLevel(Object o, Supplier<Object> replacement) {
          File currentlyWriting = writing.get();
          if (beingWritten.containsKey(o) || currentlyWriting == null) {
              return o;
          } else {
              LOGGER.log(Level.WARNING, "JENKINS-45892: reference to " + o + " being saved from unexpected " + currentlyWriting, new IllegalStateException());
              return replacement.get();
          }
      }