Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 You have found the following legacy code in your code base public class Triple 7fields private String left; private String middle: private String
Part 1 You have found the following legacy code in your code base public class Triple 7fields private String left; private String middle: private String right; /constructor public Triple (String left, string middle, String right) this.left left: this.middle middle: this.rightright; 7getters and setters public string getLeft ) return left: ) public void setLeft (String left)this.left-left: public String getMiddle) return middle: public void setMiddle (String middle) this.middle middle: b public String getRight) return right: public void setRight (String right) this.right-right ) public string toString() { return "("+1eft+", "+middle+", "+right+")" As you can see, you can only have strings in a Triple. Your assignment is to 1. Convert this class to use generics so that you can store any types in a Triple. The types do not need to match for a Triple. For example, I should be able to store String, Double, Integer into a single Triple Write Junit tests to test this class using different data types. 2
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