• Lab 1: (Solution)
    • Take a look at the full solution.
      • Solution: primlab1.java
      • Your solution may differ slightly.
    • An alternate solution for process() is as follows:
        public int process() {
          M.info("inside process() count="+count);
          count = count + 1;
      
          if (count > 20) {
            return FINISH;
          } else {
            return NORMAL;
          }
        }
      • While this alternate solution is technically correct, it is discouraged.
        • Return statements inside an if statement are hard to debug once the primitive gets complicated.
        • It is best to declare a status variable at the top of the method with a default value (usually NORMAL) and altering it as needed.