Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Point { private int x; private int y; public Point(int x, int y) { this.x=x; this.y=y; } @Override public boolean equals(Object o) {
public class Point { private int x; private int y; public Point(int x, int y) { this.x=x; this.y=y; } @Override public boolean equals(Object o) { // What code goes here? } }
1 (a) How do we *know* what code is appropriate (or not) for the equals() method?
(b) Write the code for equals() in the Point class. What would we do if Point extended some other class?
(c) let's develop some regular JUnit tests for equals() .
(d) let's develop some data-driven JUnit tests for equals().
(e) Develop some theories about the equals() method. Implement them as JUnit theories. Don't worry about Java syntax; worry about what you want to test.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started