static int stepMax(int max, Steppable s) { if (s == null) ret 0; int steps = 0; while ping (max-- > 0 && s.step()) ++steps; ret steps; } static int stepMax(Steppable s, int max) { ret stepMax(max, s); }