@Test public void testGetCourseNames() { String[] names = DomainUtil.getCourseNames(courses); assertEquals(names.length, courses.size()); for (int i = 0; i < names.length; i++) { assertEquals(names[i], courses.get(i).getName()); } }
public static String[] getCourseNames(List<Course> courses) { List<String> courseNames = new ArrayList<String>(); for (Course c : courses) { courseNames.add(c.getName()); } return courseNames.toArray(new String[0]); }
DomainUtil { public static String[] getCourseNames(List<Course> courses) { List<String> courseNames = new ArrayList<String>(); for (Course c : courses) { courseNames.add(c.getName()); } return courseNames.toArray(new String[0]); } }
DomainUtil { public static String[] getCourseNames(List<Course> courses) { List<String> courseNames = new ArrayList<String>(); for (Course c : courses) { courseNames.add(c.getName()); } return courseNames.toArray(new String[0]); }  }
DomainUtil { public static String[] getCourseNames(List<Course> courses) { List<String> courseNames = new ArrayList<String>(); for (Course c : courses) { courseNames.add(c.getName()); } return courseNames.toArray(new String[0]); }  static String[] getCourseNames(List<Course> courses); }
DomainUtil { public static String[] getCourseNames(List<Course> courses) { List<String> courseNames = new ArrayList<String>(); for (Course c : courses) { courseNames.add(c.getName()); } return courseNames.toArray(new String[0]); }  static String[] getCourseNames(List<Course> courses);  }