ImpersonationFacade implements Impersonation { @Override public boolean allows(final Subject subject) throws RepositoryException { return delegate.allows(subject); } @SuppressWarnings("WeakerAccess")  ImpersonationFacade(final @NotNull Impersonation delegate); @Override PrincipalIterator getImpersonators(); @Override boolean allows(final Subject subject); @Override boolean grantImpersonation(final Principal principal); @Override boolean revokeImpersonation(final Principal principal);  }
@Test public void testAllows() throws Exception { Impersonation delegate = mock(Impersonation.class); ImpersonationFacade facade = getFacade(delegate); final Subject subject = new Subject(); when(delegate.allows(subject)).thenReturn(true); assertTrue("is true", facade.allows(subject)); }