Remove the IndexOutOfBoundsException 

Exception in thread "Thread-1" java.lang.IndexOutOfBoundsException: Index: 0, Size: 10
	at java.util.ArrayList.rangeCheck(Unknown Source)
	at java.util.ArrayList.remove(Unknown Source)
	at Main$BuggyQueue.take(Main.java:23)
	at Main$2.run(Main.java:59)
	at java.lang.Thread.run(Unknown Source)