void () { if (myCurrentTestCase != null) { final long time = System.currentTimeMillis(); // optimization: // we shouldn't repaint if this frame was painted in current interval if (time - myLastInvocationTime >= FRAME_TIME) { repaintSubTree(); myLastInvocationTime = time; } } scheduleRepaint(); }