private void captureDifferentString(String oldName,String newName,String appName,Map<String,String> map,String defaultValue){
  Reject.ifNull(appName);
  Reject.ifNull(map);
  if (oldName == null && newName == null) {
    map.put(appName,defaultValue);
  }
 else   if (newName != null && !newName.equals(oldName)) {
    map.put(appName,newName);
  }
}

private void captureDifferentString ( String oldName , String newName , String appName , Map < String , String > map , String defaultValue ) { Reject . ifNull ( appName ) ; Reject . ifNull ( map ) ; if ( oldName == null && newName == null ) { map . put ( appName , defaultValue ) ; } else if ( newName != null && ! newName . equals ( oldName ) ) { map . put ( appName , newName ) ; } }
adds entries to the passed in map , using the supplied appname as the key . the default value will be used if both provided old and new names are null . the value inserted will be the newname value if it differs from the oldname value . no changes will be made to the map if the old and new names are equal .
