         }
     }
     
-    func heightForRow(indexPath: NSIndexPath) -> CGFloat? {
+    public func heightForRow(indexPath: NSIndexPath) -> CGFloat? {
         let childIndex = indexPath.row
         
         if case .Child(let child) = items[childIndex],
             let parentIndex = child.get.child.parentIndex,
             case .Parent(let parent) = items[parentIndex]
-            where parent.get.parent.isHidden(childIndex)
         {
-            return 0
+            if parent.get.parent.isHidden(childIndex) {
+                return 0
+            }
         }
         
         return nil
     }
     
-    var expandCollapse: (NSIndexPath, (Child) -> Void) -> [NSIndexPath] {
+    public var expandCollapse: (NSIndexPath, (Child) -> Void) -> [NSIndexPath] {
         return isMultipleExpand ? multipleExpandCollapse : singleExpandCollapse
     }
     

}

public class ChildCell<Value>: ChildCellProtocol {
    private(set) var parentIndex: Int?
    private(set) var value: Value
    
    init(parentIndex: Int?, value: Value) {
        self.parentIndex = parentIndex
        self.value = value
    }

import UIKit

public class ExpandCollapseTableViewModel<Parent: ParentTypeProtocol, Child: ChildTypeProtocol> {
    private(set) public var items = [CellType<Parent, Child>]()
    private var isMultipleExpand: Bool
    
    public init(isMultipleExpand: Bool = false) {
        self.isMultipleExpand = isMultipleExpand
    }
    
    public func removeAll() {
        items.removeAll()
    }
    
    public func append(child: Child) {
        items.append(CellType.Child(child))
    }
    
    public func append(parent: Parent, completion: (Int) -> [Child]) {
        let parentIndex = items.count
        items.append(.Parent(parent))
        let childs = completion(parentIndex)
