Given an array of n positive integers, assuming 0-based indexing, its cost is the sum from i=1 to i=(len(arr) - 1) of (arr[i] - arr[i-1])^2. We want to find the minimum possible cost of the array after inserting exactly one element. For example, the cost of the array a = [1, 3, 5, 2, 10] before insertion is (1 - 3)^2 + (3 - 5)^2 + (5 - 2)^2 + (2 - 10)^2 = 81. After inserting 6 between 2 and 10, the cost of the array a is (1 - 3)^2 + (3 - 5)^2 + (5 - 2)^2 + (2 - 6)^2 + (6 - 10)^2 = 49. It can be proven that 49 is the minimum possible cost for the array a. Complete the function public static long getMinimumCost(List arr) to solve this problem.