Question: 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 yourcode base public class Triple 7fields private String left; private String middle:

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!