import tester.Example; import tester.TestMethod; import tester.Tester; //sample class --- it is not called 'Examples' @Example class AnnotationExample2 { // private field private int n; // the required default constructor private AnnotationExample2(){} // publicly available constructor public AnnotationExample2(int n){ this.n = n; } // a sample private method // is this number bigger than the given one? private boolean biggerThan(int m){ return n > m; } // a sample test method --- does not start with 'test' @TestMethod public boolean weTestTheMethod(Tester t){ AnnotationExample2 foo = new AnnotationExample2(3); AnnotationExample2 bar = new AnnotationExample2(8); return t.checkExpect(foo.biggerThan(5), false) && t.checkExpect(foo.biggerThan(2), true) && t.checkExpect(bar.biggerThan(5), true) && t.checkExpect(bar.biggerThan(10), true, "test will fail"); } }