code: private SnapshotCodec getCurrentCodec() {
      if (codecs.isEmpty()) {
        throw new IllegalStateException(String.format("No codecs are registered."));
      }
      return codecs.get(codecs.lastKey());
    }
docs: Retrieve the current snapshot codec, that is, the codec with the highest known version.
  @return the current codec
  @throws java.lang.IllegalStateException if no codecs are registered