well to move an element from one ArrayList to the other you can do something like this:
ArrayList< SomeClass > firstList;
ArrayList< SomeClass > secondList;
int randomlySelectedIndex; //initialize this to be random
SomeClass element = firstList.get( randomlySelectedIndex );
firstList.remove( randomlySelectedIndex );
secondList.add( randomlySelectedIndex );
As for comparing elements from 2 lists, you could make a compare method like so:
int compare( SomeClass first, SomeClass second ) {
//return 0, 1 or -1 depending on your criteria of how first relates to second
}
and then use the compare method when iterating through both lists
int result;
for( int x = 0; x < firstList.size(); x++ ) {
for( int y = 0; y < secondList.size(); y++ ) {
result = compare( firstList.get( x ), secondList.get( y ) );
if( result == 0 ) {
//do stuff
}
else if( result < 0 ) {
//do stuff
}
else {
//do stuff
}
}
}
please note that you should not be adding or removing elements from either of the arraylists from inside the 2 for loops unless you know the consequences of doing so.