public static Pair<Integer, Integer> getMinimumAndMaximum(int[] array)
    {
        if (array == null || array.length == 0)
        {
            return new Pair<Integer, Integer>(null, null);
        }

       int minimum = array[0];
       int maximum = array[0];
       for (int i = 0; i < array.length; i++) {
           if (array[i] > maximum) {
               maximum = array[i];
           }
           else if (array[i] < minimum) {
               minimum = array[i];
           }
       }

        return new Pair<Integer, Integer>(minimum, maximum);
    }