boolean () { if (myHasPassedTestsCached) { return myHasPassedTests; } boolean hasPassedTests = calcPassedTests(); boolean canCache = !myState.isInProgress() && myState.wasLaunched(); if (canCache) { myHasPassedTests = hasPassedTests; myHasPassedTestsCached = true; } return hasPassedTests; }