AbstractMessageParser.validate() is operating on a List<Object>, but each implementation essentially treats the list as a queue – inquiring the first object and then maybe removing it before moving on.
This is problematic with ArrayList, as its remove() method shifts elements in the array, i.e. it has O(N) complexity and gets slower with increasing number of elements.
An alternative would be to use a LinkedList, which has O(1) remove(), but that suffers from worse locality and memory overhead.
Change the validate() method to take a Queue instead, which allows us to use an ArrayDeque – and that has O(1) operations for everything we need.