Code example for Collection

Methods: containsiteratorsize

    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. 
Connect your IDE to all the code out there  Get Codota for Java