class TresAmigosTester_v5 { static TresAmigos f1 = new TresAmigos( "Arturo", "Margarita", "Zorro" ); static TresAmigos f2 = new TresAmigos( "Arturo", "Zorro", "Margarita" ); static TresAmigos f3 = new TresAmigos( "Margarita", "Arturo", "Zorro" ); static TresAmigos f4 = new TresAmigos( "Margarita", "Zorro", "Arturo" ); static TresAmigos f5 = new TresAmigos( "Zorro", "Arturo", "Margarita" ); static TresAmigos f6 = new TresAmigos( "Zorro", "Margarita", "Arturo" ); static TresAmigos g1 = new TresAmigos( "Arturo", "Arturo", "Margarita" ); static TresAmigos g2 = new TresAmigos( "Arturo", "Margarita", "Arturo" ); static TresAmigos g3 = new TresAmigos( "Margarita", "Arturo", "Arturo" ); static TresAmigos h1 = new TresAmigos( "Zorro", "Zorro", "Zorro" ); public static void main(String[] args) { System.err.println("\nRunning Tests:" ); // Call three of our own static methods: testGetters(f1, "f1", "Arturo", "Margarita", "Zorro"); testGetters(f2, "f2", "Arturo", "Margarita", "Zorro"); testGetters(f3, "f3", "Arturo", "Margarita", "Zorro"); testGetters(f4, "f4", "Arturo", "Margarita", "Zorro"); testGetters(f5, "f5", "Arturo", "Margarita", "Zorro"); testGetters(f6, "f6", "Arturo", "Margarita", "Zorro"); testGetters(g1, "g1", "Arturo", "Arturo", "Margarita"); testGetters(g2, "g2", "Arturo", "Arturo", "Margarita"); testGetters(g3, "g3", "Arturo", "Arturo", "Margarita"); testGetters(h1, "h1", "Zorro", "Zorro", "Zorro"); System.err.println("Tests finished." ); } public static void testGetters( TresAmigos f, String posseName, String exp1, String exp2, String exp3 ) { reportIfError( posseName, "First", exp1, f.getFirst() ); reportIfError( posseName, "Second", exp2, f.getSecond() ); reportIfError( posseName, "Third", exp3, f.getThird() ); } public static void reportIfError( String posseName, String methodName, String expectedResult, String actualResult ) { if (! expectedResult.equals(actualResult)) { System.err.println( posseName + "." + "get" + methodName + " expected \"" + expectedResult + "\"" + " but got \"" + actualResult + "\"." ); } } }