For this Question: Given an array arr[] of N integers arranged in a circular fashion. Your task is to find the maximum contiguous subarray sum containing at least 1 element.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single integer N which denotes the total number of elements. The second line of each test case contains N space-separated integers denoting the elements of the array.

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= 10^5
-10^6 <= Arr[i] <= 10^6

The Sum of N over all test cases is less than equal to 10^6.For each test case print the maximum sum obtained by adding the consecutive elements.<b>Input:</b>
4
7
8 -8 9 -9 10 -11 12
8
10 -3 -4 7 6 5 -4 -1
8
-1 40 -14 7 6 5 -4 -1
4
-1 -2 -3 -4

<b>Output:</b>
22
23
52
-1

Explanation:
Testcase 1: Starting from the last element of the array, i.e, 12, and moving in a circular fashion, we have max subarray as 12, 8, -8, 9, -9, 10, which gives the maximum sum as 22., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
		static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
     public static long maxSubarraySumCircular(long[] array) {

        long currentSum = 0, maxSum = Long.MIN_VALUE;
        for(int i = 0; i < array.length; i++) {

            currentSum = Math.max(currentSum + array[i], array[i]);
            maxSum = Math.max(maxSum, currentSum);

        }

        if(maxSum < 0) return maxSum;

        currentSum = 0;
        long minSum = Long.MAX_VALUE;
        for(int i = 0; i < array.length; i++) {

            currentSum = Math.min(currentSum + array[i], array[i]);
            minSum = Math.min(minSum, currentSum);

        }

        long totalSum = 0;
        for(long element : array) totalSum += element;

        return Math.max(maxSum, totalSum - minSum);
    }
	public static void main (String[] args) {
        FastReader sc = new FastReader();
		int t = sc.nextInt();
		while(t-->0){
			int n = sc.nextInt();
			long a[] = new long[n];

			long sum = 0l;
			for(int i=0;i<n;i++){
				a[i] = sc.nextLong();

			}
           System.out.println(maxSubarraySumCircular(a));
	}
}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?