private <T> List<T> getListWithLimit(List<T> list) {
    if (ApplicationManager.getApplication().isUnitTestMode()) {
      return list;
    }
    if (mySegmentLimit == 0) {
      return Collections.emptyList();
    }
    if (mySegmentLimit > 0 && list.size() > mySegmentLimit) {
      warnTooManySegments(list.size());
      return ContainerUtil.getFirstItems(list, mySegmentLimit);
    }
    return list;
  }
private <T> List<T> getListWithLimit(List<T> list)