public void testContains() { final RevFlag flag1 = rw.newFlag("flag_1"); final RevFlag flag2 = rw.newFlag("flag_2"); final RevFlagSet set = new RevFlagSet(); set.add(flag1); assertTrue(set.contains(flag1)); assertFalse(set.contains(flag2)); assertFalse(set.contains("bob")); }
public void testRemove() { final RevFlag flag1 = rw.newFlag("flag_1"); final RevFlag flag2 = rw.newFlag("flag_2"); final RevFlagSet set = new RevFlagSet(); assertTrue(set.add(flag1)); assertTrue(set.add(flag2)); assertTrue(set.remove(flag1)); assertFalse(set.remove(flag1)); assertEquals(flag2.mask, set.mask); assertFalse(set.contains(flag1)); }