Package java.util

Examples of java.util.Set.containsAll()


     * @see Set#equals
     */
    public boolean equals(Object obj) {
        if (obj instanceof Set) {
            Set set = (Set) obj;
            if (set.containsAll(this) && set.size() == this.size()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


        entrySet = facets.entrySet();
        matches = new HashSet();
        matches.add(new TestMapEntry("a", facet1));
        matches.add(new TestMapEntry("c", facet3));
        matches.add(new TestMapEntry("d", facet4));
        assertTrue(entrySet.containsAll(matches));
        matches = new HashSet();
        matches.add(new TestMapEntry("a", facet1));
        matches.add(new TestMapEntry("c", facet3));
        matches.add(new TestMapEntry("f", facet6));
        assertTrue(!entrySet.containsAll(matches));
View Full Code Here

        assertTrue(entrySet.containsAll(matches));
        matches = new HashSet();
        matches.add(new TestMapEntry("a", facet1));
        matches.add(new TestMapEntry("c", facet3));
        matches.add(new TestMapEntry("f", facet6));
        assertTrue(!entrySet.containsAll(matches));

        // Test iterator().hasNext() and iterator().next()
        facets = component.getFacets();
        facets.clear();
        facets.putAll(preload);
View Full Code Here

        keySet = facets.keySet();
        matches = new HashSet();
        matches.add("a");
        matches.add("c");
        matches.add("d");
        assertTrue(keySet.containsAll(matches));
        matches = new HashSet();
        matches.add("a");
        matches.add("c");
        matches.add("f");
        assertTrue(!keySet.containsAll(matches));
View Full Code Here

        assertTrue(keySet.containsAll(matches));
        matches = new HashSet();
        matches.add("a");
        matches.add("c");
        matches.add("f");
        assertTrue(!keySet.containsAll(matches));

        // Test iterator().hasNext() and iterator().next()
        facets = component.getFacets();
        facets.clear();
        facets.putAll(preload);
View Full Code Here

    /**
     * getCriticalExtensionOIDs() method testing.
     */
    public void testGetCriticalExtensionOIDs() {
        Set certCEOids = certificate.getCriticalExtensionOIDs();
        if (!(certCEOids.containsAll(allCritical)
                    && allCritical.containsAll(certCEOids))) {
            fail("Incorrect value of Critical Extension OIDs");
        }
    }
   
View Full Code Here

    /**
     * getNonCriticalExtensionOIDs() method testing.
     */
    public void testGetNonCriticalExtensionOIDs() {
        Set certNCEOids = certificate.getNonCriticalExtensionOIDs();
        if (!(certNCEOids.containsAll(allNonCritical)
                    && allNonCritical.containsAll(certNCEOids))) {
            fail("Incorrect value of Non Critical Extension OIDs");
        }
    }
   
View Full Code Here

        assertEquals("failed for non-existent service", 0, alg1.size());

        alg1 = Security.getAlgorithms("SecureRandom");
        alg2 = Security.getAlgorithms("seCuReranDom");
        assertEquals("different size", alg1.size(), alg2.size());
        assertTrue("different content", alg2.containsAll(alg1));

        Provider p = new MyProvider();

        try {
            Security.addProvider(p);
View Full Code Here

    if (c.isEmpty())
      return false;

    Set set = getSet();
    if (set.containsAll(c))
      return false;

    Set additions = new HashSet(c);
    additions.removeAll(set);
View Full Code Here

     */
    public void testKeySetToArray() {
        Jsr166HashMap map = map5();
        Set s = map.keySet();
        Object[] ar = s.toArray();
        assertTrue(s.containsAll(Arrays.asList(ar)));
        assertEquals(5, ar.length);
        ar[0] = m10;
        assertFalse(s.containsAll(Arrays.asList(ar)));
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.