/* * Selector - this class provides static methods for * selecting the minimum, maximum and median of three * comparable values. */ public class Selector { public static int min( Testable x1, Testable x2, Testable x3 ) { if ( x1.isLessThan( x2 ) ) { if ( x1.isLessThan( x3 ) ) return 1; else return 3; } else { if ( x2.isLessThan( x3 ) ) return 2; else return 3; } } }