private <T> T accessChanges(@NotNull Supplier<T> func) {
    if (isLocked) {
      return func.get();
    }

    synchronized (myChanges) {
      return func.get();
    }
  }
private <T> T accessChanges(@NotNull Supplier<T> func)