liquibase-core/src/main/java/liquibase/util/JdbcUtils.java
public static Object requiredSingleResult(Collection results) throws DatabaseException {
        int size = ((results != null) ? results.size() : 0);
        if (size == 0) {
            throw new DatabaseException("Empty result set, expected one row");
        }
        if (results.size() > 1) {
            throw new DatabaseException("Result set larger than one row");
        }
        return results.iterator().next();
    }
public static Object requiredSingleResult(Collection results) throws DatabaseException {
        int size = ((results != null) ? results.size() : 0);
        if (size == 0) {
            throw new DatabaseException("Empty result set, expected one row");
        }
        if (results.size() > 1) {
            throw new DatabaseException("Result set larger than one row");
        }
        return results.iterator().next();
    }
Return a single result object from the given Collection.
<p>Throws an exception if 0 or more than 1 element found.
@param results the result Collection (can be <code>null</code>)
@return the single result object