1. if(state == null) should be done first .
In the same method setState ,
replace the exception message with this :
"is a container queue , its state always running and cannot be reset."
throw new IllegalStateException(this.name +
" is a container queue and cannot be in STOPPED state.");
In the above scenario , the if check should be before we add children.I think it should be before
children == null check , first statement in the method.
The message above should be adding child to a queue with state as stopped.
Also mention in comments that this check is not required if Queue object is built from the XML , this indescrepency
might happen if this Queue is directly built.