package Examples; import java.util.logging.Logger; import Sequenic.T3.SuiteUtils.Inference.Comment; /** * This floating point Triangle class is very hard to cover for a random-based tool. * Note: does not actually check that the sum of two sides should be less or equal * to the third. * */ public class Triangle { private double a = 1 ; private double b = 2 ; private double c = 3 ; private final static Comment comment = new Comment(Logger.getLogger(Triangle.class.getName())) ; public Triangle() {} public void setA(double a) { if (a<=0) throw new IllegalArgumentException() ; comment.with("valid side").end() ; this.a = a ; } public void setB(double b) { if (b<=0) throw new IllegalArgumentException() ; comment.with("valid side").end() ; this.b = b ; } public void setC(double c) { if (c<=0) throw new IllegalArgumentException() ; comment.with("valid side").end() ; this.c = c ; } public boolean isEquilateral() { boolean r = a==b && b==c ; return r ; } public boolean isIsoleces() { boolean r = a==b || b==c || a==c ; return r ; } public boolean isScalene() { boolean r = a!=b && b!=c && a!=c ; return r ; } }