Tab { @Override public int hashCode() { return Objects.hash(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 shouldCheckHashCodeForEquivalentObjects() { Tab tab1 = new Tab(title, tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.REMOVABLE); Tab tab2 = new Tab(title, tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.REMOVABLE); assertThat(tab1.hashCode(), is(tab2.hashCode())); }
@Test public void shouldCheckHashCodeForNotEquivalentObjects() { Tab tab1 = new Tab(title, tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.REMOVABLE); Tab tab2 = new Tab("title", tabPresenter, scopes, handler, TabType.LEFT, Tab.VisibleState.REMOVABLE); assertThat(tab1.hashCode(), is(not(tab2.hashCode()))); }