@Test
public void testRecursiveObject() throws Exception {

	List<Menu> children = new ArrayList<Menu>();
	children.add(new Menu("x"));
	children.add(new Menu("y"));
	children.add(new Menu("z"));
	
	List<Menu> parent = new ArrayList<Menu>();
	parent.add(new Menu("a").setChildren(children));
	parent.add(new Menu("b"));
	parent.add(new Menu("c"));
	
	List<Menu> result = CollectionMethod.recursive(parent, "getChildren");
	
	Assert.assertEquals(6, result.size());
	Assert.assertEquals("a", result.get(0).getName());
	Assert.assertEquals("x", result.get(1).getName());
	Assert.assertEquals("y", result.get(2).getName());
	Assert.assertEquals("z", result.get(3).getName());
	Assert.assertEquals("b", result.get(4).getName());
	Assert.assertEquals("c", result.get(5).getName());
}