HashMap map = new HashMap();
HashMap<String,Integer> map = new HashMap<String,Integer>();
    public static String getPartition(FlatNode node) {        if (isEliminated(node)) {                return getPartition((FlatNode)nodeMaster.get(node));            } else {            SIROperator op = node.contents;                if (op instanceof SIRFilter) {                int partition = (partitionMap.get(op)) + 1;                return new String(""+partition);            }            if (op instanceof SIRJoiner) {                // joiner not fused to anything by cluster fusion                if (node.edges[0] != null && node.edges[0].contents instanceof SIRFilter) {                    String part = getPartition(node.edges[0]);                    return part;                }                             // integrate backwards to partition that is communicating                // most with this one.                SIRJoiner join = (SIRJoiner)op;                HashMap map = new HashMap(); // String partition->Integer sum                int[] weights = join.getWeights();                for (int i=0; i<weights.length; i++) {                    String part = getPartition(node.incoming[i]);                    Integer _oldSum = (Integer)map.get(part);                    int oldSum = 0;                    if (_oldSum!=null) {                        oldSum = _oldSum.intValue();                    }                    map.put(part.intern(), new Integer(oldSum+weights[i]));                }                        int max = -1;                String result = null;                Iterator it = map.keySet().iterator();                while (it.hasNext()) {                    String part = (String)it.next();                    int sum = ((Integer)map.get(part)).intValue();                    if (sum>max) {                        max = sum;                        result = part;                    }                }                assert result!=null;                return result;            }            if (op instanceof SIRSplitter) {                // splitter not fused to anything by cluster fusion                     if (node.incoming[0]==null) {                    // if we hit the top (a null splitter), assign to partition 0                    return "1";                }                         // integrate backward if reading from a filter                if (node.incoming[0] != null && node.incoming[0].contents instanceof SIRFilter) {                    String part = getPartition(node.incoming[0]);                    return part;                }                // integrate forwards to partition that is communicating                // most with this one.                SIRSplitter split = (SIRSplitter)op;                HashMap map = new HashMap(); // String partition->Integer sum                int[] weights = split.getWeights();                for (int i=0; i<weights.length; i++) {                    String part = getPartition(node.edges[i]);                    Integer _oldSum = (Integer)map.get(part);                    int oldSum = 0;                    if (_oldSum!=null) {                        oldSum = _oldSum.intValue();                    }                    map.put(part.intern(), new Integer(oldSum+weights[i]));                }                        int max = -1;                String result = null;                Iterator it = map.keySet().iterator();                while (it.hasNext()) {                    String part = (String)it.next();                    int sum = ((Integer)map.get(part)).intValue();                    if (sum>max) {                        max = sum;                        result = part;                    }                }                assert result!=null;                return result;            }                 if (op instanceof SIRIdentity) {                // if we find identity that wasn't assigned, integrate it                // into its destination (arbitrarily -- could just as well                // be the source)                return getPartition(node.edges[0]);            }            return null;        }    }