@Test public void testHashCodeNotEqualsWithParentClass() { Vertex vertex1 = new Vertex.Builder("com.actor", "action").markSpecial().build(); CucumberVertex testVertex2 = new CucumberVertex.Builder("com.actor", "action").withFeaturePath("feature").withScenarioLine(10).markSpecial().build(); int vertex1HashCode = vertex1.hashCode(); int vertex2HashCode = testVertex2.hashCode(); assertNotEquals(vertex1, testVertex2); assertNotEquals(vertex1HashCode, vertex2HashCode); assertEquals(vertex1HashCode, vertex1.hashCode()); assertEquals(vertex2HashCode, testVertex2.hashCode()); }
@Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), featurePath, scenarioLine); }
CucumberVertex extends TestVertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), featurePath, scenarioLine); } }
CucumberVertex extends TestVertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), featurePath, scenarioLine); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  CucumberVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                          String location, boolean ignore, boolean externalLocation, String featurePath, int scenarioLine, boolean affected); }
CucumberVertex extends TestVertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), featurePath, scenarioLine); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  CucumberVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                          String location, boolean ignore, boolean externalLocation, String featurePath, int scenarioLine, boolean affected); String getFeaturePath(); int getScenarioLine(); @Override boolean equals(Object o); @Override int hashCode(); boolean isAffected(); }
CucumberVertex extends TestVertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), featurePath, scenarioLine); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  CucumberVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                          String location, boolean ignore, boolean externalLocation, String featurePath, int scenarioLine, boolean affected); String getFeaturePath(); int getScenarioLine(); @Override boolean equals(Object o); @Override int hashCode(); boolean isAffected();  }