Code example for Set

Methods: contains

0
 
        assertTrue(intent.hasCategory("category.name.1"));
        assertTrue(intent.hasCategory("category.name.2"));
 
        Set<String> categories = intent.getCategories();
        assertTrue(categories.contains("category.name.1"));
        assertTrue(categories.contains("category.name.2"));
 
        intent.removeCategory("category.name.1");
        assertFalse(intent.hasCategory("category.name.1"));
        assertTrue(intent.hasCategory("category.name.2"));
 
        intent.removeCategory("category.name.2");
        assertFalse(intent.hasCategory("category.name.2"));
 
        assertEquals(0, intent.getCategories().size());
 
        assertSame(self, intent);
    } 
 
    @Test