/** 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));
 }
Пример #4
0
  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);
  }
Пример #5
0
 @Override
 public void removeMemberRoleListener(ChatRoomMemberRoleListener listener) {
   memberRoleListeners.remove(listener);
 }
Пример #6
0
 @Override
 public void addMemberRoleListener(ChatRoomMemberRoleListener listener) {
   memberRoleListeners.add(listener);
 }
Пример #7
0
 @Override
 public void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener) {
   localUserRoleListeners.remove(listener);
 }
Пример #8
0
 @Override
 public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener) {
   localUserRoleListeners.add(listener);
 }
Пример #9
0
 @Override
 public void removeMemberPresenceListener(ChatRoomMemberPresenceListener listener) {
   synchronized (memberListeners) {
     memberListeners.remove(listener);
   }
 }
Пример #10
0
 @Override
 public void addMemberPresenceListener(ChatRoomMemberPresenceListener listener) {
   synchronized (memberListeners) {
     memberListeners.add(listener);
   }
 }