Question: This is my code. import static org.junit.Assert.*; import org.junit.*; import java.util.*; public class StudentSortSearchTest { //@Test public static void testSort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){ ArrayList students

This is my code.

import static org.junit.Assert.*;

import org.junit.*;

import java.util.*;

public class StudentSortSearchTest {

//@Test

public static void testSort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

ArrayList students = new ArrayList();

//Test to see if it is being sorted by name or by age

if(criteria == StudentSortSearch.SortSearchCriteria.AGE){

students.add(new Student("Mike", "Jones", 18));

students.add(new Student("Mohamed", "Ali", 19));

students.add(new Student("John", "Smith", 21));

students.add(new Student("Brittney", "Spears", 30));

assertArrayEquals(arrA.toArray(), students.toArray());

}else{

students.add(new Student("Brittney", "Spears", 30));

students.add(new Student("John", "Smith", 21));

students.add(new Student("Mike", "Jones", 18));

students.add(new Student("Mohamed", "Ali", 19));

assertArrayEquals(arrA.toArray(), students.toArray());

}

}

public static void testMergesort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

testSort(arrA, criteria);

}

public static void testQuicksort(ArrayList arrA, StudentSortSearch.SortSearchCriteria criteria){

testSort(arrA, criteria);

}

public static void testBinarySearch(Student stu1){

Student stuA = new Student("Brittney", "Spears", 30);

assertEquals(stu1,stuA);

}

}

But when I run it I keep getting this error: error: cannot find symbol

How can I fix this?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!