void () { cancelCurrentUpdate(); boolean isTestMode = ApplicationManager.getApplication().isUnitTestMode(); Image image = !isTestMode && isShowing() ? paintToImage(this) : null; if (image != null) { myCachedImage = image; } myPresentationFactory.reset(); myVisibleActions.clear(); removeAll(); if (!isTestMode && image == null) { addLoadingIcon(); } }