src/test/java/ucar/geoapi/NetcdfCRSTest.java
private static <E> E assertSingleton(final Iterable<? extends E> collection) {
        assertNotNull("Null collection.", collection);
        final Iterator<? extends E> it = collection.iterator();
        assertTrue("The collection is empty.", it.hasNext());
        final E element = it.next();
        assertFalse("The collection has more than one element.", it.hasNext());
        return element;
    }
/**
     * Returns the single element from the given collection. If the given collection is null
     * or does not contains exactly one element, then an {@link AssertionError} is thrown.
     *
     * @param  <E>         the type of collection elements.
     * @param  collection  the collection from which to get the singleton.
     * @return the singleton element from the collection.
     */
Returns the single element from the given collection. If the given collection is null
or does not contains exactly one element, then an  AssertionError is thrown.

@param           the type of collection elements.
@param  collection  the collection from which to get the singleton.
@return the singleton element from the collection.
Returns the single element from the given collection . If the given collection is null or does not contains exactly one element then an AssertionError is thrown . @param the type of collection elements . @param collection the collection from which to get the singleton . @return the singleton element from the collection .
private static <E> E assertSingleton(final Iterable<? extends E> collection) {
        assertNotNull("Null collection.", collection);
        final Iterator<? extends E> it = collection.iterator();
        assertTrue("The collection is empty.", it.hasNext());
        final E element = it.next();
        assertFalse("The collection has more than one element.", it.hasNext());
        return element;
    }
private static < E > E assertSingleton ( final Iterable < ? extends E > collection ) { assertNotNull ( "Null collection." , collection ) ; final Iterator < ? extends E > it = collection . iterator ( ) ; assertTrue ( "The collection is empty." , it . hasNext ( ) ) ; final E element = it . next ( ) ; assertFalse ( "The collection has more than one element." , it . hasNext ( ) ) ; return element ; }
Returns the single element from the given collection.
Returns the single element from the given collection .