- protected Close validate(final List<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
- Preconditions.checkArgument(objects != null, "Passed list can't be null.");
- if (objects.isEmpty() || !(objects.get(0) instanceof CClose)) {
+ protected Close validate(final Queue<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
+ checkArgument(objects != null, "Passed list can't be null.");
+ final Object o = objects.poll();
+ if (!(o instanceof CClose)) {