Let's say I have a method called 'test' which should return the arraylist called 'theList' containing X number of Integers.
How would I do that?

public static void test(){
    SOME CODE
    ...
    return theList
}

What should 'void' and 'theList' be replaced with in that code to make it work?

It would be declared as follows...

public static ArrayList<A_CLASS_NAME> test() {
  // instantiate an empty array list of A_CLASS_NAME
  ArrayList<A_CLASS_NAME> theList = new ArrayList<A_CLASS_NAME>();
  ...
  return theList;
}