public static <T> T getOnlyElement(Iterable<T> iterable) {
        if (iterable == null) {
            throw new IllegalArgumentException("iterable cannot be null.");
        }
        Iterator<T> iterator = iterable.iterator();
        T first = iterator.next();
        if (!iterator.hasNext()) {
            return first;
        }
        throw new IllegalArgumentException(buildExceptionMessage(iterator, first));
    }
@Test
    void testGetOnlyElementIllegalArgumentException2() {
        assertThrows(IllegalArgumentException.class, () -> {
            CollectionUtils.getOnlyElement(null);
        });
    }