A example use of Strategy pattern in Java