@Test
public void testEquals() {

    Definition definition = new Definition();
    definition.setName("myDefinition");
    definition.setExtends("myExtends");
    Attribute attribute1 = new Attribute("value1");
    definition.putAttribute("name1", attribute1);
    Attribute attribute2 = new Attribute("value2");
    definition.putAttribute("name2", attribute2);
    Definition toCheck = new Definition(definition);
    assertTrue(definition.equals(toCheck));
    toCheck = new Definition(definition);
    toCheck.setName("anotherDefinition");
    assertFalse(definition.equals(toCheck));
    toCheck = new Definition(definition);
    toCheck.setExtends("anotherExtends");
    assertFalse(definition.equals(toCheck));
    toCheck = new Definition(definition);
    toCheck.putAttribute("name1", new Attribute("anotherAttribute"));
    assertFalse(definition.equals(toCheck));
}