/** removeAll removes all elements from the given collection */ public void testRemoveAll() { List full = populatedArray(3); Vector v = new Vector(); v.add(one); v.add(two); full.removeAll(v); assertEquals(1, full.size()); }
/** addAll adds each element from the given collection */ public void testAddAll() { List full = populatedArray(3); Vector v = new Vector(); v.add(three); v.add(four); v.add(five); full.addAll(v); assertEquals(6, full.size()); }
/** containsAll returns true for collection with subset of elements */ public void testContainsAll() { List full = populatedArray(3); Vector v = new Vector(); v.add(one); v.add(two); assertTrue(full.containsAll(v)); v.add(six); assertFalse(full.containsAll(v)); }
public static void main(String[] args) { showSelf(); TestThread myThread1 = new TestThread(); TestThread myThread2 = new TestThread(); myThread1.start(); myThread2.start(); int[] a1 = {1, 2, 3, 4, 5}; int[] a2; a2 = a1; for (int i = 0; i < a2.length; i++) { a2[i]++; } for (int i = 0; i < a1.length; i++) { prt("a1[" + i + "] = " + a1[i]); } Vector v = new Vector(); for (int i = 0; i < 5; i++) { v.addElement(new Test()); } System.out.println(v); }
@Override public void removeMemberRoleListener(ChatRoomMemberRoleListener listener) { memberRoleListeners.remove(listener); }
@Override public void addMemberRoleListener(ChatRoomMemberRoleListener listener) { memberRoleListeners.add(listener); }
@Override public void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener) { localUserRoleListeners.remove(listener); }
@Override public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener) { localUserRoleListeners.add(listener); }
@Override public void removeMemberPresenceListener(ChatRoomMemberPresenceListener listener) { synchronized (memberListeners) { memberListeners.remove(listener); } }
@Override public void addMemberPresenceListener(ChatRoomMemberPresenceListener listener) { synchronized (memberListeners) { memberListeners.add(listener); } }