I am new to java and array lists. I am supposed to sort populate an array full of random integers, then if there is a run (multiples of the same number in a row), put ( ) around that run. 
So if the random list is:

2 3 4 5 5 5 5 6 7 7 9

2 3 4 (5 5 5 5) 6 (7 7) 9

This is what I have so far:

```
import java.util.*;

class Run {
  public static void main (String [] args){

    Scanner m = new Scanner(System.in);

    System.out.print("Enter length wanted: ");
    int len = m.nextInt();

    System.out.print("Enter max number wanted: ");
    int max = m.nextInt();
    max = max -1;

   int[] x = new int[len]; 
   ArrayList<String> y = new ArrayList<String>();

   //Filling x with random numbers
   for(int i = 0; i<len; i++){

    x[i] = ((int)(Math.random()*max)+1); 

   }

   System.out.println("Orginal Array: " + Arrays.toString(x));

   for(int i = 0; i<=len-1; i++){
     if(x[i] == x[i++]){ //I just don't know how I am exactly supposed to sort this

     }else{

     }

  }
   //Array List with ()
   System.out.println("Runs labeled Array: " + y);

  }
}

```