@NotNull
  private <T> List<T> takeRequests(@NotNull List<? extends T> list) {
    synchronized (lock) {
      final List<T> requests = new ArrayList<>(list);
      list.clear();
      return requests;
    }
  }
@NotNull
  private <T> List<T> takeRequests(@NotNull List<? extends T> list)