int getOrCalculate(int row, int col, Supplier<Integer> supplier) {
      Integer cached = table.get(row)[col];
      if (cached != null) return cached;

      Integer newVal = supplier.get();
      table.get(row)[col] = newVal;
      return newVal;
    }
int getOrCalculate(int row, int col, Supplier<Integer> supplier)