### Question:
MongoDbWidget extends WidgetImpl { @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (getId() != null ? getId().hashCode() : 0); return result; } MongoDbWidget();  MongoDbWidget(String id); List<String> getCategoryIds(); void setCategoryIds(List<String> categoryIds); CategoryRepository getCategoryRepository(); void setCategoryRepository(CategoryRepository categoryRepository); @Override List<Category> getCategories(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void hashCode_Valid(){ assertNotNull(widget.hashCode()); }
@Test public void hashCode_Null(){ widget.setId(ID_1); assertNotNull(widget.hashCode()); }