gt: 		if (node.getChildren() != null) {
context: package com.github.easyadmin.util.file_tree;
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.Stack;
  
  import com.github.easyadmin.request.ListFilesRequest;
  
  public class FileTree implements Iterable<Node> {
  	private long autoincrementedID = 0;
  	
  	private FileWalker fileWalker;
  	
  	private Map<Long, Node> nodeMap;
  	private ArrayList<Node> roots;
  	
  	private class NodeIterator implements Iterator<Node> {
  		private Iterator<Node> currentIterator;
  		private Stack<Iterator<Node>> hierarchy = new Stack<Iterator<Node>>();
  		
  		public NodeIterator(Node root) {
  			if (root == null) {
  				throw new NullPointerException(); 
  			}
  			
  			if (root.isFile() || root.getChildren() == null) {
  				currentIterator = new ArrayList<Node>().iterator();
  			} else {
  				currentIterator = root.getChildren().iterator();
  			}
  		}
  		
  		@Override
  		public boolean hasNext() {
  			if (currentIterator.hasNext()) {
  				return true;
  			}
  			
  			for (Iterator<Node> it : hierarchy) {
  				if (it.hasNext()) {
  					return true;
  				}
  			}
  			
  			return false;
  		}
  
  		@Override
  		public Node next() {
  			if (currentIterator.hasNext()) {
  				Node node = currentIterator.next();
  				
  				if (!node.isFile() && node.getChildren() != null) {
  					hierarchy.push(currentIterator);
  					currentIterator = node.getChildren().iterator();
  				}
  				
  				return node;
  			}
  			
  			if (hierarchy.isEmpty()) {
  				return null;
  			}
  			
  			currentIterator = hierarchy.pop();
  			return next();
  		}
  
  		@Override
  		public void remove() {
  		}
  	}
  	
  	public interface Renderer {
  		public void render(long id, String filePath, boolean isFile, int nestingDepth);
  	}
  	
  	public interface FileWalker {
  		public List<ListFilesRequest.FileInfo> getSystemRoots() throws IOException;
  		public List<ListFilesRequest.FileInfo> listFiles(String parentDirectoryPath) throws IOException;
  	}
  	
  	public FileTree(FileWalker fileWalker)
  			throws IOException
  	{
  		this.fileWalker = fileWalker;
  		List<ListFilesRequest.FileInfo> rootPaths = fileWalker.getSystemRoots();
  		
  		if (rootPaths == null) {
  			throw new IOException("Failed to get remote device system roots");
  		}
  		
  		roots = new ArrayList<Node>();
  		nodeMap = new HashMap<Long, Node>();
  		for (ListFilesRequest.FileInfo infoObject : rootPaths) {
  			Node rootNode = createNode(infoObject, 0);
  			roots.add(rootNode);
  			nodeMap.put(rootNode.getID(), rootNode);
  		}
  		
  	}
  	
  	public List<Node> getSystemRoots()
  	{
  		return roots;
  	}
  	
  	public Node getById(long ID)
  	{
  		if (!nodeMap.containsKey(ID)) {
  			return null;
  		}
  		
  		return nodeMap.get(ID);
  	}
  	
  	@Override
  	public Iterator<Node> iterator() {
  		Node root = new DirectoryElement("", -1, 0);
  		
  		for (Node r : roots) {
  			try {
  				root.addChild(r);
  			} catch (Exception e) {
  				e.printStackTrace();
  			}
  		}
  		
  		return new NodeIterator(root);
  	}
  	
  	public void render(Renderer renderer)
  	{
  		for (Node node : roots) {
  			renderNode(node, renderer);
  		}
  	}
  	
  	public void render(Renderer renderer, long ID)
  	{
  		if (nodeMap.containsKey(ID)) {
  			Node node = nodeMap.get(ID);
  			renderNode(node, renderer);
  		}
  	}
  	
  	public void unfold(long id)
  			throws IOException
  	{
  		if (!nodeMap.containsKey(id)) {
  			return;
  		}
  		
  		Node node = nodeMap.get(id);
  		
  		if (node.isFile()) {
  			return;
  		}
  		
  		if (node.getChildren() == null) {
  			List<ListFilesRequest.FileInfo> infoObjects = fileWalker.listFiles(node.getAbsolutePath());
  			
  			if (infoObjects == null) {
  				throw new NullPointerException();
  			}
  			
  			for (ListFilesRequest.FileInfo fileInfo : infoObjects) {
  				try {
  					Node child = createNode(fileInfo, node.getNestingDepth() + 1);
  					node.addChild(child);
  					nodeMap.put(child.getID(), child);
  				} catch (Exception e) {
  					e.printStackTrace();
  				}
  			}
  		}
  		
  	}
  	
  	public void fold(long id)
  	{
  		if (!nodeMap.containsKey(id)) {
  			return;
  		}
  		
  		Node node = nodeMap.get(id);
  		
  		if (node.isFile()) {
  			return;
  		}
  		
  		foldNode(node);
  	}
  	
  	private void foldNode(Node node)
  	{
  		if (node.isFile()) {
  			nodeMap.remove(node.getID());
  			return;
  		}
  		
  