protected static void printProperties(String key,String value,PrintStream ps,Properties createdProperties){
  if (ps != null) {
    ps.println(key + "=" + value);
  }
  if (createdProperties != null) {
    createdProperties.put(key,value);
  }
}

protected static void printProperties ( String key , String value , PrintStream ps , Properties createdProperties ) { if ( ps != null ) { ps . println ( key + "=" + value ) ; } if ( createdProperties != null ) { createdProperties . put ( key , value ) ; } }
a simple helper method that writes key - value pairs to a print stream or properties , whatever is not null .
