PrivilegeManagerFacade implements PrivilegeManager { @Override public Privilege[] getRegisteredPrivileges() throws RepositoryException { return delegate.getRegisteredPrivileges(); } PrivilegeManagerFacade(final @NotNull PrivilegeManager delegate); @Override Privilege[] getRegisteredPrivileges(); @Override Privilege getPrivilege(final String privilegeName); @Override Privilege registerPrivilege(final String privilegeName,
                                       final boolean isAbstract,
                                       final String[] declaredAggregateNames);  }
@Test public void testGetRegisteredPrivilege() throws Exception { PrivilegeManager delegate = mock(PrivilegeManager.class); PrivilegeManagerFacade facade = getFacade(delegate); final Privilege[] value = new Privilege[0]; when(delegate.getRegisteredPrivileges()).thenReturn(value); assertSame("is same value", value, facade.getRegisteredPrivileges()); }