Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Identify the impact of convergence culture on society.

Answered: 1 week ago