Advertisement
mr1302

Untitled

Oct 15th, 2021
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. import java.util.LinkedList;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         WaitList<Integer> l1 = new WaitList<>();
  7.         l1.add(1);
  8.         l1.add(2);
  9.         l1.add(3);
  10.         l1.add(4);
  11.         System.out.println(l1);
  12.         l1.remove();
  13.         l1.remove();
  14.         System.out.println(l1 + "\n");
  15.         BoundedWaitList<String> l2 = new BoundedWaitList<>(3);
  16.         l2.add("one");
  17.         l2.add("two");
  18.         l2.add("three");
  19.         l2.add("four");
  20.         System.out.println(l2 + "\n");
  21.         UnfairWaitList<Integer> l3 = new UnfairWaitList<>();
  22.         l3.add(1);
  23.         l3.add(2);
  24.         l3.add(3);
  25.         l3.add(4);
  26.         l3.add(5);
  27.         l3.add(3);
  28.         l3.add(6);
  29.         l3.add(1);
  30.         l3.add(6);
  31.         System.out.println(l3);
  32.         l3.remove(1);
  33.         System.out.println(l3);
  34.         l3.remove(3);
  35.         System.out.println(l3);
  36.         l3.moveToBack(2);
  37.         System.out.println(l3);
  38.         l3.add(3);
  39.         System.out.println(l3);
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement