public synchronized void saveConfig() throws IOException {
    String jsonString;
    synchronized (registry) {
      clearNotExistsPackages();
      jsonString = heliumConf.toJson();
    }

    File heliumConfFile = new File(heliumConfPath);
    if (!heliumConfFile.exists()) {
      heliumConfFile.createNewFile();
    }

    FileUtils.writeStringToFile(heliumConfFile, jsonString);
  }
@Test
  void testSaveLoadConf() throws IOException, URISyntaxException, TaskRunnerException {
    // given
    File heliumConf = new File(tmpDir, "helium.conf");
    Helium helium = new Helium(heliumConf.getAbsolutePath(), localRegistryPath.getAbsolutePath(),
        null, null, null, null, zConf);
    assertFalse(heliumConf.exists());

    // when
    helium.saveConfig();

    // then
    assertTrue(heliumConf.exists());

    // then load without exception
    new Helium(heliumConf.getAbsolutePath(), localRegistryPath.getAbsolutePath(), null, null, null,
        null, zConf);
  }