Build a Bounded Generic Range Class
mediumQuestion 506Write a generic class that represents a range between a low value and a high value. It should work for any type whose values can be compared, such as Integer, String or Double, so the type parameter needs a bound.
Requirements:
1. Change the class header so the class is generic with a bounded type parameter: Range<T extends Comparable<T>>.
2. Store two private fields of type T, low and high, set by the constructor Range(T low, T high).
3. boolean contains(T value) returns true when value is not below low and not above high. Both ends count as inside. Compare with compareTo, because < and > do not work on a T.
4. toString() returns the two ends inside square brackets with two dots between them. A range from 13 to 19 gives [13..19].
Do NOT write a main method.
Expected output
[13..19] true true false false
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...