### Question:
SearchModel { @Override public int hashCode() { int result = q != null ? q.hashCode() : 0; result = 31 * result + (offset != null ? offset.hashCode() : 0); result = 31 * result + (limit != null ? limit.hashCode() : 0); result = 31 * result + Arrays.hashCode(fields); result = 31 * result + Arrays.hashCode(sort); result = 31 * result + Arrays.deepHashCode(filter); result = 31 * result + (int) (totalCount ^ (totalCount >>> 32)); return result; } SearchModel(); String getQ(); void setQ(String q); Integer getOffset(); void setOffset(Integer offset); Integer getLimit(); void setLimit(Integer limit); String[] getFields(); void setFields(String[] fields); String[] getSort(); void setSort(String[] sort); String[][] getFilter(); void setFilter(String[][] filter); void setFilterExpression(String filter); long getTotalCount(); void setTotalCount(long totalCount); HttpServletResponse getResponse(); void setResponse(HttpServletResponse response); @JsonIgnore void addFilter(String field, String operator, String value); @JsonIgnore void addSort(String field, String operator); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void hashCodeTest() { SearchModel model1 = new SearchModel(); SearchModel model2 = new SearchModel(); this.check(model1, model2); String[] fields = new String[]{"field1", "field2"}; model1.setFields(fields); model2.setFields(fields); this.check(model1, model2); Integer offset = 0; model1.setOffset(offset); model2.setOffset(offset); this.check(model1, model2); Integer limit = 10; model1.setLimit(limit); model2.setLimit(limit); this.check(model1, model2); String q = "query"; model1.setQ(q); model2.setQ(q); this.check(model1, model2); String[] sort = new String[]{"field1+", "field2-"}; model1.setSort(sort); model2.setSort(sort); this.check(model1, model2); long totalCount = 30; model1.setTotalCount(totalCount); model2.setTotalCount(totalCount); this.check(model1, model2); HttpServletResponse httpServletResponse = new Response(null, null); model1.setResponse(httpServletResponse); model2.setResponse(httpServletResponse); this.check(model1, model2); String[][] filter = new String[][]{new String[]{"field1", "=", "val"}}; model1.setFilter(filter); model2.setFilter(filter); }