@SuppressWarnings("static-method") @Test public void testEqualsObject() { final List<Edge<Character>> edges1 = allEdges(); final List<Edge<Character>> edges2 = allEdges(); for (int i = 0; i < edges1.size(); i++) { final Edge<Character> edge1 = edges1.get(i); for (int j = 0; j < edges2.size(); j++) { final Edge<Character> edge2 = edges2.get(j); Assert.assertEquals( String.format("%s.equals(%s); ", edge1, edge2), i == j, edge1.equals(edge2)); Assert.assertEquals( String.format("%s.equals(%s); ", edge2, edge1), i == j, edge2.equals(edge1)); } } }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IEdge)) { return false; } final IEdge<?> other = (IEdge<?>) obj; if (state != other.getState()) { return false; } final Object otherSymbol = other.getSymbol(); if (symbol == null) { if (otherSymbol != null) { return false; } } else if (!symbol.equals(otherSymbol)) { return false; } return true; }
Edge implements IEdge<S> { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IEdge)) { return false; } final IEdge<?> other = (IEdge<?>) obj; if (state != other.getState()) { return false; } final Object otherSymbol = other.getSymbol(); if (symbol == null) { if (otherSymbol != null) { return false; } } else if (!symbol.equals(otherSymbol)) { return false; } return true; } }
Edge implements IEdge<S> { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IEdge)) { return false; } final IEdge<?> other = (IEdge<?>) obj; if (state != other.getState()) { return false; } final Object otherSymbol = other.getSymbol(); if (symbol == null) { if (otherSymbol != null) { return false; } } else if (!symbol.equals(otherSymbol)) { return false; } return true; } Edge(final S symbol_, final int state_); }
Edge implements IEdge<S> { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IEdge)) { return false; } final IEdge<?> other = (IEdge<?>) obj; if (state != other.getState()) { return false; } final Object otherSymbol = other.getSymbol(); if (symbol == null) { if (otherSymbol != null) { return false; } } else if (!symbol.equals(otherSymbol)) { return false; } return true; } Edge(final S symbol_, final int state_); @Override S getSymbol(); @Override int getState(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
Edge implements IEdge<S> { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IEdge)) { return false; } final IEdge<?> other = (IEdge<?>) obj; if (state != other.getState()) { return false; } final Object otherSymbol = other.getSymbol(); if (symbol == null) { if (otherSymbol != null) { return false; } } else if (!symbol.equals(otherSymbol)) { return false; } return true; } Edge(final S symbol_, final int state_); @Override S getSymbol(); @Override int getState(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }