ArrayList<PermissionFactory> list = new ArrayList<>();
int eventType;
while ((eventType = reader.nextTag()) != END_DOCUMENT) {
switch (eventType) {
case END_TAG: {
specBuilder.setPermissionCollection(new FactoryPermissionCollection(list.toArray(new PermissionFactory[list.size()])));
return;
}
case START_TAG: {
validateNamespace(reader);
switch (reader.getName()) {