public T get(int zoom) {
    @SuppressWarnings("unchecked") T[] casted = (T[]) values;
    int off = zoom - minzoom;
    if (values[off] != null) {
      return casted[off];
    }
    return casted[off] = supplier.apply(zoom);
  }
Returns a cache for {@code supplier} that can handle a min/max zoom range specified in {@code config}.

@param supplier function that will be called with each zoom-level to get the value
@param <T>      return type of the function
@return a cache for {@code supplier} by zom
planetiler-core/src/main/java/com/onthegomap/planetiler/util/CacheByZoom.java