public static NestedClass Create(int deep) { var parent = new NestedClass(); AppendChild(parent, deep); return(parent); }
public static void AppendChild(NestedClass parent, int deep) { var child = new NestedClass(); parent.Nested = child; if (deep > 0) { AppendChild(child, --deep); } }