Company: Salesforce Offcampus customer engineer_21march
Difficulty: medium
Implement a class called Edge that represents an edge in a directed graph. The class should override the following functions such that any two edge objects can be compared by value. Implement the following methods in the Edge class: public static Edge createEdge(int fromNode, int toNode) : A factory method that creates and returns a new Edge instance. public boolean equals(Object object) : An overridden function to check if the current and passed objects' attribute values are the same. public int compareTo(Edge edge) : Compares this Edge with another Edge for ordering. public int hashCode() : Generates a hash code for the Edge object to support storing in hash tables. public String toString() : Returns a string representation of the Edge in the format "From node: <fromNode> To node: <toNode>". The program will read input that consists of multiple edges. If duplicate edges are provided, they should only be counted once in the final result. Constraints 1 ≤ numberOfQueries