protected void wireClasses() {
        LinkedList<ParsedClass> unwiredClasses = new LinkedList<ParsedClass>(parsedClasses.values());
        while (unwiredClasses.size() > 0) {
            // remove & process first class from the list
            ParsedClass parsedClass = unwiredClasses.poll();
            boolean parentsWired = true;
            for (Iterator<String> it = parsedClass.getInheritanceClasses().iterator(); it.hasNext() && parentsWired; ) {
                String parent = it.next();
                parentsWired &= !parsedClasses.containsKey(parent) || parsedClasses.get(parent).isInheritanceWired();
            }
            // all parents are complete, we can inherit safe methods
            if (parentsWired) {
                for (String parent : parsedClass.getInheritanceClasses()) {
                    if (parsedClasses.containsKey(parent)) {
                        parsedClass.getMethods().addAll(parsedClasses.get(parent).getMethods());
                    }
                }
                parsedClass.setInheritanceWired(true);
            } else {
                // add back to the end of the list
                unwiredClasses.offer(parsedClass);
            }
        }
    }