Question: Implement these comparable methods listed in white to pass the given test code. The test code should not be changed but all methods should be
Implement these comparable methods listed in white to pass the given test code. The test code should not be changed but all methods should be implemented and pass.
Project must compile, otherwise no grade.
JavaDoc for Main class points
Tests passing for MainTest class hidden tests points
Test class as follows: import java.util.Arrays;
public class Main
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
public class MainTest
private Main intData intData;
private Main doubleData doubleData;
@BeforeEach
public void setUp
intData new Mainnew Integer;
intData new Mainnew Integer;
doubleData new Mainnew Double;
doubleData new Mainnew Double;
@Test
public void testMergeSort
testHelperMergeSortintData;
testHelperMergeSortintData;
testHelperMergeSortdoubleData;
testHelperMergeSortdoubleData;
private void testHelperMergeSortMain data
T expected Arrays.copyOfdatadata, data.data.length;
Arrays.sortexpected;
assertArrayEqualsexpected data.mergeSort "MergeSort did not sort correctly";
@Test
public void testQuickSort
testHelperQuickSortintData;
testHelperQuickSortintData;
testHelperQuickSortdoubleData;
testHelperQuickSortdoubleData;
private void testHelperQuickSortMain data
T expected Arrays.copyOfdatadata, data.data.length;
Arrays.sortexpected;
assertArrayEqualsexpected data.quickSort "QuickSort did not sort correctly";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
