private void assignStratifierValuesByKey( final StratNode<K> node, final LinkedList<Object> states) { if (node.isLeaf()) { // we're here! if (states.isEmpty()) throw new ReviewedGATKException("Found a leaf node with an empty state values vector"); stratifierValuesByKey.set( node.getKey(), Collections.unmodifiableList(new ArrayList<Object>(states))); } else { for (Map.Entry<Object, StratNode<K>> entry : node.getSubnodes().entrySet()) { final LinkedList<Object> newStates = new LinkedList<Object>(states); newStates.addLast(entry.getKey()); assignStratifierValuesByKey(entry.getValue(), newStates); } } }