for (Statistics node : statisticsList) {
if (node.getGuiPath().contains(":")) {
String prevPath = node.getGuiPath().substring(0, node.getGuiPath().lastIndexOf(":"));
Statistics prevNode = possibleLeafNodes.get(prevPath);
if (prevNode != null) {
//PrevPath is not a leaf. Remove it from Hash
possibleLeafNodes.remove(prevPath);
notLeafNodes.put(prevPath, prevNode);
}
//Check if this node is a possible leaf
Statistics currNode = notLeafNodes.get(node.getGuiPath());
if (currNode != null) {
//This is not a leaf node. Skipping
} else {
possibleLeafNodes.put(node.getGuiPath(), node);
}