private String getMatchedGSNodeFor(String rm)
    {
        //TODO: optimize this, maybe create a cached index from RM -> GS
        String matchedGSNode = null;
        for (String gsNode : matchedRMs.keySet()) {
            Set<String> rms = getMatchedRMsFor(gsNode);
            if (rms.contains(rm)) {
                matchedGSNode = gsNode;
            }
        }

        if (matchedGSNode == null) {
            System.out.println("This shouldn't happen... (getMatchedGSNodeFor)");
            Thread.dumpStack();
            System.exit(1);
        }

        return matchedGSNode;
    }