Implementation of Kadane's 2D Algorithm in Java