### Question:
SearchOptions { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final SearchOptions other = (SearchOptions) obj; if (!expressions.equals(other.expressions)) { return false; } if (!sortOrder.equals(other.sortOrder)) { return false; } return true; } SearchOptions(); SortOrder getSortOrder(); void setSortOrder(final SortOrder order); Map<String, String> getExpressions(); void setExpressions(final Map<String, String> expressions); SearchOptions withSortOrder(final SortOrder order); SearchOptions withExpressions(final Map<String, String> expressions); @Override int hashCode(); @Override boolean equals(final Object obj); static final SearchOptions DEFAULT; }### Answer:
@Test public void shouldEquals_withSameObject() { final SearchOptions searchOptions = new SearchOptions(); assertTrue(searchOptions.equals(searchOptions)); }
@Test public void shouldNotEquals_withNull() { final SearchOptions searchOptions = new SearchOptions(); assertFalse(searchOptions.equals(null)); }
@Test public void shouldNotEquals_withDifferentClass() { final SearchOptions searchOptions = new SearchOptions(); assertFalse(searchOptions.equals(Randoms.randomString(20))); }
@Test public void shouldEquals() { final SearchOptions searchOptions001 = new SearchOptions(); final SearchOptions searchOptions002 = new SearchOptions(); assertTrue(searchOptions001.equals(searchOptions002)); assertTrue(searchOptions002.equals(searchOptions001)); }