void (Element element, TodoPattern[] patterns) { element.setAttribute(ATTRIBUTE_NAME, myName); for (TodoPattern pattern : myTodoPatterns) { int index = ArrayUtilRt.find(patterns, pattern); LOG.assertTrue(index != -1); Element child = new Element(ELEMENT_PATTERN); child.setAttribute(ATTRIBUTE_INDEX, Integer.toString(index)); element.addContent(child); } }