/** Test of getAllByGender method, of class Course. */ @Test public void testGetAllByGender() { System.out.println("getAllByGender"); String gender = "Male"; List<Student> students = new ArrayList<Student>(); students.add(new Student("sahil", "c0657966", "Male", 80.3)); Course instance = new Course(students); Student stu = new Student("Simar", "c0657050", "Female", 60.3); instance.insert(stu, 1); String expResult = "[{\"name\":\"sahil\",\"id\":\"c0657966\",\"gender\":\"Male\",\"grade\":80.3}]"; String result = instance.getAllByGender(gender).toString(); assertEquals(expResult, result); }