private <TRef, TResult> @NotNull Map<TRef, TResult> getMap(int index) {
    //noinspection unchecked
    AtomicReferenceArray<Map<TRef, TResult>> array = (AtomicReferenceArray<Map<TRef,TResult>>)(AtomicReferenceArray<?>)myMaps;
    Map<TRef, TResult> map = array.get(index);
    if (map == null) {
      map = array.updateAndGet(index, oldMap -> oldMap == null ? createWeakMap() : oldMap);
    }
    return map;
  }
private <TRef, TResult> @NotNull Map<TRef, TResult> getMap(int index)