Tab { public void performHandler() { if (handler == null) { return; } handler.onTabSelected(); } Tab(@NotNull String title,
               @NotNull TabPresenter tabPresenter,
               @NotNull Set<State> scopes,
               @Nullable TabSelectHandler handler,
               @NotNull TabType tabType,
               @NotNull VisibleState visibleState); @NotNull String getTitle(); @NotNull TabPresenter getTab(); void setScopes(@NotNull Set<State> scopes); boolean isAvailableScope(@NotNull State scope); void performHandler(); @NotNull TabType getTabType(); boolean isRemovable(); @Override boolean equals(Object other); @Override int hashCode();  }
@Test public void shouldPerformHandler() { tab.performHandler(); verify(handler).onTabSelected(); }
@Test public void shouldPerformHandlerWhenHandlerIsNull() { tab = new Tab(title, tabPresenter, scopes, null, TabType.LEFT, Tab.VisibleState.VISIBLE); tab.performHandler(); verify(handler, never()).onTabSelected(); }