private static <T> @Nullable T getOnlyElement(@NotNull Iterable<T> iterable) {
    Iterator<T> it = iterable.iterator();
    if (!it.hasNext()) return null;
    T firstValue = it.next();
    return it.hasNext() ? null : firstValue;
  }
private static <T> @Nullable T getOnlyElement(@NotNull Iterable<T> iterable)