Schedule { public List<String> analysis() { ArrayList<String> result = new ArrayList<String>(); if (credits < minCredits) result.add("Too few credits"); if (credits > maxCredits && !overloadAuthorized) result.add("Too many credits"); checkDuplicateCourses(result); checkOverlap(result); return result; } Schedule(String name); static void deleteAll(); static Schedule create(String name); static Schedule find(String name); static Collection<Schedule> all(); void update(); void add(Offering offering); void authorizeOverload(boolean authorized); List<String> analysis(); void checkDuplicateCourses(ArrayList<String> analysis); void checkOverlap(ArrayList<String> analysis); String toString();  }
@Test public void testMinCredits() { Schedule schedule = new Schedule("name"); Collection<String> analysis = schedule.analysis(); assertEquals(1, analysis.size()); assertTrue(analysis.contains("Too few credits")); }