code: public void saveWithTrainingConfig(OutputStream outputStream) throws IOException {
          if(this.trainingConfig == null) {
              throw new IllegalStateException("No training configuration found!");
          }
  
          saveWithTrainingConfig(this.trainingConfig,outputStream);
      }
docs: Save this samediff instance with its training config.
  Note that if a training configuration is not defined,
  an {@link IllegalStateException} is thrown.
  
  @param outputStream the output stream to write to
  @throws IOException