package stub; public class MyDate { ... ... 略 详见附件 public MyDate(int year, int month, LeapJduge lj) { ... ... this.lj = lj; } int lastDayMonth() { int i = 0; switch (month) { ...... case 10: case 12: i = 31; break; case 4: ... ... case 11: i = 30; break; case 2: i = lj.isLeap(year) ? 29 : 28; default: throw new IllegalArgumentException("month is out of range"); } return i; } } package stub; public interface LeapJduge { boolean isLeap(int year); } 说明: MyDate 的lastDayMonth方法,求某月的天数,比如 new MyDate(2000,2,LeapJduge的对象).lastDayMonth() 可以返回2000年2月的天数。其中第3个参数是实现 LeapJduge接口的对象。 要求: 1)使用junit对lastDayMonth方法进行测试,要求对所有月份测试,并对闰年和非闰年的2月都要测。 2)使用stub代替LeapJduge。其isLeap方法判断某年是否闰年,假设我们不会写这个方法:)如何用stub来代替正式的,LeapJduge的对象? 提交物: junit的测试代码