@@ -0,0 +1,1351 @@
+package arrays.maximum_sub_array;%0Aimport arrays.maximum_sub_array.SubArray; %09%09%09// My implementation of class SubArray to hold result sub array%0Aimport arrays.maximum_sub_array.MaximumSubArray;%09// My implementation of Kadane's algorithm to find maximum sub array%0A%0A/*%0A%09This class tests Kadane's Maximum sub array algorithm%0A*/%0A%0Aclass TestMaximumSubArray%7B%0A%0A%09// Tests with valid as well as invalid input%0A%0A%09public static void testA()%7B%0A%0A%09%09// Define test arrays%0A%0A%09%09int a1%5B%5D = %7B-2,-3,4,-1,-2,1,5,-3%7D;%0A%09%09int a2%5B%5D = %7B-5,-4,-7,-6,-3,-2,-1,-9%7D;%0A%09%09int a3%5B%5D = %7B%7D;%0A%09%09int a4%5B%5D = %7B10,-15,5,-2,4,19,-30,20,4%7D;%0A%09%09int a5%5B%5D = %7B1,-1,1,-2,1,1,2,1,4,-4,5%7D;%0A%09%09int a6%5B%5D = null;%0A%09%09int a7%5B%5D = %7B2,-1,-1,5,-4,9%7D;%0A%0A%09%09// Find maximum sum sub arrays%0A%0A%09%09SubArray s1 = MaximumSubArray.find(a1);%0A%09%09SubArray s2 = MaximumSubArray.find(a2);%0A%09%09SubArray s3 = MaximumSubArray.find(a3);%0A%09%09SubArray s4 = MaximumSubArray.find(a4);%0A%09%09SubArray s5 = MaximumSubArray.find(a5);%0A%09%09SubArray s6 = MaximumSubArray.find(a6);%0A%09%09SubArray s7 = MaximumSubArray.find(a7);%0A%09%09// Display results%0A%0A%09%09System.out.println(s1);%0A%09%09System.out.println(s2);%0A%09%09%0A%09%09if(s3 == null)%0A%09%09%09System.out.println(%22s3 null%22);%0A%0A%09%09System.out.println(s4);%0A%09%09System.out.println(s5);%0A%0A%09%09if(s6 == null)%0A%09%09%09System.out.println(%22s6 null%22);%0A%0A%09%09System.out.println(s7);%0A%0A%09%7D%0A%0A%0A%09public static void main(String args%5B%5D)%7B%0A%0A%09%09// Call testA%0A%09%09testA();%0A%09%7D%0A%0A%7D%09

Add test class for Kadane's algorithm