static <T> T applyOrElse(ZoomFunction<T> fn, int zoom, T defaultValue) {
    if (fn == null) {
      return defaultValue;
    }
    T result = fn.apply(zoom);
    return result == null ? defaultValue : result;
  }
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