code: public static String getStringValue(Object newValue, String defaultValue) {
          if (newValue == null)
              return defaultValue;
  
          return (String) newValue;
      }
docs: If the value is null, return the defaultValue.
  Otherwise return the new value.