code: private <T> T fromMetadata(Function<ContainerMetadata, T> getter) {
          ContainerMetadataUpdateTransaction txn = getActiveTransaction();
          return getter.apply(txn == null ? this.metadata : txn);
      }
docs: Returns the result of the given function applied either to the current UpdateTransaction (if any), or the base metadata,
  if no UpdateTransaction exists.
  
  @param getter The Function to apply.
  @param <T>    Result type.
  @return The result of the given Function.