JAVA: The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if a list contains 1, 4, 7, 8, and 10, then the mean is 6 and the median is 7. Write an application that allows you to enter five integers and displays the values, their mean, and their median. Save the file as MeanMedian.java RevisetheMeanMedianclasssothattheusercanenteranynumberofvaluesup to 20. If the list has an even number of values, the median is the numeric average of the values in the two middle positions. Save the file as MeanMedian2.java Solution Source code: import java.util.*; class methods { public int sum (List a) { if (a.size() > 0) { int sum = 0; for (Integer i : a) { sum += i; } return sum; } return 0; } public double mean (List a) { int sum = sum(a); double mean = 0; mean = sum / (a.size() * 1.0); return mean; } public double median (List a) { int middle = a.size()/2; if (a.size() % 2 == 1) { return a.get(middle); } else { return (a.get(middle-1) + a.get(middle)) / 2.0; } } class t { public static void main (String[]args) { methods m = new methods(); List c = Arrays.asList(1,4,7,8,10); Collections.sort(c); System.out.println(m.median(c)); System.out.println(m.mean(c)); } }.