private static boolean getBooleanProperty(
     Function function, String propertyKey, boolean defaultValue) {
   Object value = function.getProperty(propertyKey);
   return value instanceof Boolean ? (Boolean) value : defaultValue;
 }
 private static String getStringProperty(Function function, String propertyKey) {
   Object value = function.getProperty(propertyKey);
   return value instanceof String ? (String) value : "";
 }