Implemented Strategy pattern from a java source.