Tab { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Tab)) { return false; } Tab tab = (Tab)other; return Objects.equals(title, tab.title); } 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 shouldEqualsWhenObjectIsSame() { assertThat(tab.equals(tab), is(true)); }
@Test public void shouldNotEqualsWhenObjectHasTypeNotTab() { assertThat(tab.equals(new Object()), is(false)); }
@Test public void shouldNotEqualsWhenObjectIsNewTabWithAnotherTitle() { Tab tab2 = new Tab("new Title", tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.VISIBLE); assertThat(tab.equals(tab2), is(false)); }
@Test public void shouldEqualsWhenObjectIsNewTabButTitleIsSame() { Tab tab2 = new Tab(title, tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.REMOVABLE); assertThat(tab.equals(tab2), is(true)); }