static int applyAsIntOrElse(ZoomFunction<? extends Number> fn, int zoom, int defaultValue) {
    if (fn == null) {
      return defaultValue;
    }
    Number result = fn.apply(zoom);
    return result == null ? defaultValue : result.intValue();
  }
Invoke a function at a zoom level and returns {@code defaultValue} if the function or result were null.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/ZoomFunction.java