As an example of a behavior-based control program the leJOS NXJ distribution contains a BumperCar program. It consists of two behaviors DriveForward and DetectWall both implementing the interface Behavior and a main program BumperCar that uses an instance of the class Arbitrator to control the activation of the two behaviors.
First, make BumperCar run the base sumo wrestler driving base mounted with a bumper and an ultrasonic sensor.