private static Container toSubProcess(IdGenerator idGenerator, Map<String, Object> m) throws ParserException {
Object steps = m.get(STEPS_KEY);
if (steps == null) {
throw new ParserException("Mandatory 'steps' section missing in the subprocess: " + m);
}
if (!(steps instanceof List)) {
throw new ParserException("Unsupported element in the steps section of the subprocess: " + m);
}
List<Object> l = (List<Object>) steps;
if (l.isEmpty()) {
throw new ParserException("Empty 'steps' section in the subprocess: " + m);
}
List<AbstractElement> children = addEntryPoint(idGenerator, toElements(idGenerator, l));
String subId = idGenerator.nextId();
SubProcess sub = new SubProcess(subId, children);
return new Container(sub, sub, toBoundaryEvents(idGenerator, subId, m));
}