package test3; /** * This class represents an elastic band. Each elastic band * has a length. */ public class ElasticBand { /** * Returns the length of this elastic band. * * @return the length of this elastic band. */ public double getLength() { } /** * Sets the length of this elastic band to the given length. * * @param length the new length of this elastic band. * @pre. length > 0 */ public void setLength(double length) { } /** * Returns an elastic band with the given length. * * @param length the length of the elastic band. * @pre. length > 0 * @return an elastic band with the given length. */ public static ElasticBand getInstance(double length) { } /** * Tests whether this elastic band is the same as the * given object. Two elastic bands are the same if * their length differ by less than 0.01. * * @param object an object. * @return true if this elastic band is the same as the * given object, false otherwise. */ public boolean equals(Object object) { } /** * Stretches the length of this elastic band by the given factor. * For example, if the length of this elastic band is 3 and it * is stretched by a factor 1.5 then its length becomes 4.5. * * @param factor the stretch factor * @pre. factor > 0 && factor < 5 */ public void stretch(double factor) { } }