### Question:
GlobalArchetypeTablePresenter extends AbstractArchetypeTablePresenter { @Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); } @Inject  GlobalArchetypeTablePresenter(final View view,
                                         final ArchetypeListPresenter archetypeListPresenter,
                                         final BusyIndicatorView busyIndicatorView,
                                         final TranslationService ts,
                                         final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                         final ArchetypePreferences archetypePreferences,
                                         final Caller<ArchetypeService> archetypeService,
                                         final PreferenceScopeFactory preferenceScopeFactory,
                                         final Promises promises,
                                         final AuthorizationManager authorizationManager,
                                         final User user); @Override Promise<Void> loadPreferences(final PaginatedArchetypeList paginatedList); @Override Promise<Void> makeDefaultValue(final String alias,
                                          final boolean updateList); @Override ArchetypeTableConfiguration initConfiguration(); @Override boolean canMakeChanges(); @Override Promise<Void> savePreferences(final boolean updateList);  }### Answer:
@Test public void canMakeChangesWhenTrueTest() { doReturn(true).when(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); final boolean result = presenter.canMakeChanges(); assertTrue(result); verify(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); }
@Test public void canMakeChangesWhenFalseTest() { doReturn(false).when(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); final boolean result = presenter.canMakeChanges(); assertFalse(result); verify(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); }