!752 sS suckerID = "#1004698"; static interface Algorithm { S predict(int max); void feed(S s); } // simple test algorithm sclass TestAlgo implements Algorithm { char c; public S predict(int max) { ret str(c); } public void feed(S s) { c = last(s); } } p { wakeSucker(suckerID, "TestAlgo", new TestAlgo); } static void wakeSucker(S suckerID, S desc, Algorithm algo) { ping(); print("Waking..."); O sucker = run(suckerID); print("Feeding..."); Class intrface = getClass(sucker, "main$Algorithm"); assertNotNull("main$Algorithm", intrface); O proxy = proxy(intrface, algo); O result = callOpt(sucker, "suck", desc, proxy); print("Suck Result: " + struct(result)); cleanUp(sucker); }