### Question:
CategoricalVariableType extends AbstractEntity implements VariableType { @Override public boolean equals(Object obj) { if (obj != null && obj instanceof CategoricalVariableType) { CategoricalVariableType other = (CategoricalVariableType) obj; return EqualsUtil.equal(d_cats, other.d_cats); } return false; } CategoricalVariableType();  CategoricalVariableType(List<String> cats); BasicMeasurement buildMeasurement(); BasicMeasurement buildMeasurement(int size); String getType(); Set<? extends Entity> getDependencies(); ObservableList<String> getCategories(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final String PROPERTY_CATEGORIES; }### Answer:
@Test public void testEquals() { JUnitUtil.assertNotEquals(d_var, null); JUnitUtil.assertNotEquals(d_var, new RateVariableType()); CategoricalVariableType var2 = new CategoricalVariableType(d_cats); assertEquals(d_var, var2); assertEquals(d_var.hashCode(), var2.hashCode()); var2.getCategories().add("Trans gender"); JUnitUtil.assertNotEquals(d_var, var2); }