code: public synchronized void persistProperties(Properties properties, File propsFile, String message) {
      Properties toWrite = new Properties();
      for(String key : properties.stringPropertyNames()) {
  
        if(System.getProperties().containsKey(key) && !properties.getProperty(key).equals(System.getProperty(key))) {
  
          toWrite.setProperty(key, properties.getProperty(key));
        } 
        else if(System.getenv().containsKey(key) && !properties.getProperty(key).equals(System.getenv(key))) {
  
          toWrite.setProperty(key, properties.getProperty(key));
        } 
        else if(!System.getProperties().containsKey(key) && !System.getenv().containsKey(key)){
  
          toWrite.setProperty(key, properties.getProperty(key));
        }
      }
      writer.persistProperties(toWrite, propsFile, message, log);
    }
docs: Persist properties that are not system env or other system properties, in a thread synchronized manner