try {
Map<String, List<String>> classes = new HashMap<String, List<String>>();
for (TypeElement te : elements) {
for (Element e : env.getElementsAnnotatedWith(te)) {
final RestModelExtension annotation = e.getAnnotation(RestModelExtension.class);
final String parent = annotation.parent();
List<String> list = classes.get(parent);
if (list == null) {
list = new ArrayList<String>();
classes.put(parent, list);
}