To be able to process something as asynchronous element of program you must start new Thread for that operation. In Java exists special API, that support this type of operations.
You will need to use class Thread and interface Runnable.
{ //Body of some method
List<Object> sourceList = getList();
final List<Object> firstList = createFirstList(sourceList);
final List<Object> secondList = createsecondList(sourceList);
//Define the Runnable, that will store the logic to process the lists.
Runnable processFirstList = new Runnable() {//We create anonymous class
@Override
public void run() {
//Here you implement the logic to process firstList
}
};
Runnable processSecondList = new Runnable() {//We create anonymous class
@Override
public void run() {
//Here you implement the logic to process secondList
}
};
//Declare the Threads that will be responsible for execution of runable logic
Thread firstListThread = new Thread(processFirstList);
Thread secondListThread = new Thread(processSecondList);
//Start the Threads
firstListThread.start();
secondListThread.start();
}
You should read the tutorial