protected void encodeIconForNodeState(
     FacesContext context,
     AbstractTree tree,
     AbstractTreeNode treeNode,
     TreeNodeState nodeState,
     String customIcon)
     throws IOException {
   if (Strings.isNullOrEmpty(customIcon)) {
     encodeDefaultIcon(
         context,
         treeNode,
         concatClasses(
             nodeState.getIconClass(),
             treeNode.getAttributes().get("iconClass"),
             tree.getAttributes().get("iconClass")));
   } else {
     encodeCustomIcon(
         context,
         treeNode,
         concatClasses(
             nodeState.getCustomIconClass(),
             treeNode.getAttributes().get("iconClass"),
             tree.getAttributes().get("iconClass")),
         customIcon);
   }
 }