@@ -0,0 +1,418 @@
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class NumberManager %7B%0A%09private int lastNumber = 0;%0A%09private List queueNumbers = new ArrayList();%0A%09%0A%09public synchronized Integer generateNewNumber()%7B%0A%09%09queueNumbers.add(++lastNumber);%0A%09%09return lastNumber;%0A%09%7D%0A%09%0A%09public synchronized Integer fetchNumber()%7B%0A%09%09if(queueNumbers.size()%3E0)%7B%0A%09%09%09return (Integer)queueNumbers.remove(0);%0A%09%09%7Delse%7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create NumberManager.java