This content has been marked as final. Show 2 replies
tschodt wrote:If your Edges are indeed pairs of integers (as opposed to pairs of coordinates), you might save time if your Edge class simply extends/wraps java.awt.Point, because it is already a pair of integers and has ready-made equals() and hashCode() methods defined.
Have your EdgeFactory.getEdgeSet(int size) method return a Set<Edge> and keep adding random Edge instances to the Set until you reach the desired Set size.
Implement equals() and hashCode() in your Edge class.