I am trying to get a Object to move in a random direction when touching Rock.class but when I look on the Greenfoot API for the methods that go with java.util.list there is limited methods that would correlate with the function if touching. I know this may be easy for some but I am very new to this. I have if(size(0)) { true }. but there is a compiling error. Once again. I need the Wombat to move in a random direction when touching Rock.class but the code is setup in Java.util.list.
Any help is apprectiated. Thank you so much.

