@Test
public void testEnsureBestWrapper() {

    assertNull("just null", AuthorizableFacade.ensureBestWrapper(null));
    Authorizable justDelegate = mock(Authorizable.class);
    AuthorizableFacade<Authorizable> justFacade = getFacade(justDelegate);
    assertSame("same facade", justFacade, AuthorizableFacade.ensureBestWrapper(justFacade));
    assertTrue("is facade", AuthorizableFacade.ensureBestWrapper(justDelegate) instanceof AuthorizableFacade);
    User userDelegate = mock(User.class);
    assertTrue("is facade", AuthorizableFacade.ensureBestWrapper(userDelegate) instanceof UserFacade);
    Group groupDelegate = mock(Group.class);
    assertTrue("is facade", AuthorizableFacade.ensureBestWrapper(groupDelegate) instanceof GroupFacade);
    SuperAuthz superDelegate = mock(SuperAuthz.class);
    assertTrue("is facade", AuthorizableFacade.ensureBestWrapper(superDelegate) instanceof AuthorizableFacade);
}