How do you create a list l and then access a random element of that list?
java.util.List list = new java.util.ArrayList();
import java.util.List; import java.util.ArrayLIst;
List list = new ArrayList();
if ( ! list.isEmpty() )
Object obj = null; // for element from list if ( ! list.isEmpty() ) obj = list.get( Greenfoot.getRandomNumber( list.size() ) ); if ( obj != null) // etc.