cache(data, factory) {
    const cached = this.map.get(data);

    if (cached) {
      return cached;
    } else {
      const result = factory(data);
      this.map.set(data, result);
      return result;
    }
  }
Returns a result unique to each input data
@param {*} data Input data
@param {*} factory Function used to create the unique result