Code example for Collection

Methods: contains, iterator, size

    public Pair(Collection<? extends T> values) 
        if (values == null)
            throw new IllegalArgumentException("Input collection cannot be null");
    	if (values.size() == 2)
                throw new IllegalArgumentException("Pair cannot contain null values");
            Iterator<? extends T> iter = values.iterator();
            first =;
            second =;
            throw new IllegalArgumentException("Pair may only be created from a Collection of exactly 2 elements");
     * Creates a <code>Pair</code> from the passed array. 
     * The size of the array must be 2.