@Test
public void testEnsureBestWrapper() throws Exception {

    Item alreadyFacade = getFacade(mock(Node.class));
    assertSame("same if already facade", alreadyFacade, ItemFacade.ensureBestWrapper(alreadyFacade, sessionFacade));
    Item versionHistory = mock(VersionHistory.class);
    assertTrue("is VersionHistory", ItemFacade.ensureBestWrapper(versionHistory, sessionFacade) instanceof VersionHistoryFacade);
    Item version = mock(Version.class);
    assertTrue("is Version", ItemFacade.ensureBestWrapper(version, sessionFacade) instanceof VersionFacade);
    Item justNode = mock(Node.class);
    assertTrue("is Node", ItemFacade.ensureBestWrapper(justNode, sessionFacade) instanceof NodeFacade);
    Item justProperty = mock(Property.class);
    assertTrue("is Property", ItemFacade.ensureBestWrapper(justProperty, sessionFacade) instanceof PropertyFacade);
    Item justItem = mock(Item.class);
    assertTrue("is Item", ItemFacade.ensureBestWrapper(justItem, sessionFacade) instanceof ItemFacade);
}