private static @Nullable <T> T getTheOnlyItemOrNull(@NotNull List<T> collection) {
    if (collection.size() == 1) {
      return collection.get(0);
    }
    else {
      return null;
    }
  }
private static @Nullable <T> T getTheOnlyItemOrNull(@NotNull List<T> collection)