docs: public static void addObjectToFile(@NonNull File f, @NonNull String key, @NonNull Object o){
          Preconditions.checkState(f.exists(), "File must exist: %s", f);
          Preconditions.checkArgument(!(UPDATER_BIN.equalsIgnoreCase(key) || NORMALIZER_BIN.equalsIgnoreCase(key)
                  || CONFIGURATION_JSON.equalsIgnoreCase(key) || COEFFICIENTS_BIN.equalsIgnoreCase(key)
                  || NO_PARAMS_MARKER.equalsIgnoreCase(key) || PREPROCESSOR_BIN.equalsIgnoreCase(key)),
                  "Invalid key: Key is reserved for internal use: \"%s\"", key);
          File tempFile = null;
          try {
              // copy existing model to temporary file
              tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
              Files.copy(f, tempFile);
              f.delete();
              try (ZipFile zipFile = new ZipFile(tempFile);
                   ZipOutputStream writeFile =
                           new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(f)))) {
                  // roll over existing files within model, and copy them one by one
                  Enumeration<? extends ZipEntry> entries = zipFile.entries();
                  while (entries.hasMoreElements()) {
                      ZipEntry entry = entries.nextElement();
  
                      log.debug("Copying: {}", entry.getName());
  
                      InputStream is = zipFile.getInputStream(entry);
  
                      ZipEntry wEntry = new ZipEntry(entry.getName());
                      writeFile.putNextEntry(wEntry);
  
                      IOUtils.copy(is, writeFile);
                      writeFile.closeEntry();
                      is.close();
                  }
  
                  //Add new object:
                  ZipEntry entry = new ZipEntry("objects/" + key);
                  writeFile.putNextEntry(entry);
  
                  try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos)){
                      oos.writeObject(o);
                      byte[] bytes = baos.toByteArray();
                      writeFile.write(bytes);
                  }
                  writeFile.closeEntry();
  
                  writeFile.close();
                  zipFile.close();
  
              }
          } catch (Exception ex) {
              throw new RuntimeException(ex);
          } finally {
              if (tempFile != null) {
                  tempFile.delete();
              }
          }
      }