@Test @SuppressWarnings("unchecked") public void testEqualsWhenProjectDiagramIsDifferentMetadata() { final Metadata metadataOne = makeMetadata(); final Metadata metadataTwo = makeMetadata(); doReturn("moduleOne").when(metadataOne).getTitle(); doReturn("moduleTwo").when(metadataTwo).getTitle(); final DiagramImpl projectDiagram1 = new DiagramImpl("Diagram", makeGraph(), metadataOne); final DiagramImpl projectDiagram2 = new DiagramImpl("Diagram", makeGraph(), metadataTwo); final KogitoDiagramResourceImpl projectDiagramResource1 = new KogitoDiagramResourceImpl(projectDiagram1); final KogitoDiagramResourceImpl projectDiagramResource2 = new KogitoDiagramResourceImpl(projectDiagram2); assertNotEquals(projectDiagramResource1, projectDiagramResource2); assertNotEquals(projectDiagramResource1.hashCode(), projectDiagramResource2.hashCode()); }
@Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), Objects.hashCode(xmlDiagram), Objects.hashCode(type)); }
KogitoDiagramResourceImpl implements KogitoDiagramResource<Diagram> { @Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), Objects.hashCode(xmlDiagram), Objects.hashCode(type)); } }
KogitoDiagramResourceImpl implements KogitoDiagramResource<Diagram> { @Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), Objects.hashCode(xmlDiagram), Objects.hashCode(type)); } KogitoDiagramResourceImpl(final @MapsTo("projectDiagram") Diagram projectDiagram,
                                     final @MapsTo("xmlDiagram") String xmlDiagram,
                                     final @MapsTo("type") DiagramType type);  KogitoDiagramResourceImpl(final Diagram projectDiagram);  KogitoDiagramResourceImpl(final String xmlDiagram); }
KogitoDiagramResourceImpl implements KogitoDiagramResource<Diagram> { @Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), Objects.hashCode(xmlDiagram), Objects.hashCode(type)); } KogitoDiagramResourceImpl(final @MapsTo("projectDiagram") Diagram projectDiagram,
                                     final @MapsTo("xmlDiagram") String xmlDiagram,
                                     final @MapsTo("type") DiagramType type);  KogitoDiagramResourceImpl(final Diagram projectDiagram);  KogitoDiagramResourceImpl(final String xmlDiagram); @Override boolean equals(final Object o); @Override int hashCode(); @Override Optional<Diagram> projectDiagram(); @Override Optional<String> xmlDiagram(); @Override DiagramType getType(); }
KogitoDiagramResourceImpl implements KogitoDiagramResource<Diagram> { @Override public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(projectDiagram), Objects.hashCode(xmlDiagram), Objects.hashCode(type)); } KogitoDiagramResourceImpl(final @MapsTo("projectDiagram") Diagram projectDiagram,
                                     final @MapsTo("xmlDiagram") String xmlDiagram,
                                     final @MapsTo("type") DiagramType type);  KogitoDiagramResourceImpl(final Diagram projectDiagram);  KogitoDiagramResourceImpl(final String xmlDiagram); @Override boolean equals(final Object o); @Override int hashCode(); @Override Optional<Diagram> projectDiagram(); @Override Optional<String> xmlDiagram(); @Override DiagramType getType();  }