@SuppressWarnings("ConstantConditions")
@Test
public void testUnwrap() throws Exception {

    assertNull("unwrap null to null", ItemFacade.unwrap(null));
    Item justNodeDelegate = mock(Node.class);
    assertSame("same Item delegate by itself", justNodeDelegate, ItemFacade.unwrap(justNodeDelegate));
    Item justNodeFacade = getFacade(justNodeDelegate);
    assertSame("same Item delegate", justNodeDelegate, ItemFacade.unwrap(justNodeFacade));
    Property propertyDelegate = mock(Property.class);
    Item propertyFacade = getFacade(propertyDelegate);
    assertSame("same Property delegate", propertyDelegate, ItemFacade.unwrap(propertyFacade));
    Node versionDelegate = mock(Version.class);
    Item versionFacade = getFacade(versionDelegate);
    assertSame("same Version delegate", versionDelegate, ItemFacade.unwrap(versionFacade));
    Node versionHistoryDelegate = mock(VersionHistory.class);
    Item versionHistoryFacade = getFacade(versionHistoryDelegate);
    assertSame("same VersionHistory delegate", versionHistoryDelegate, ItemFacade.unwrap(versionHistoryFacade));
}