void (@NotNull Function<TargetEnvironment, String> code) { myInitialized.doWhenDone( () -> { TargetEnvironment targetEnvironment = myTargetEnvironment; if (targetEnvironment == null) { throw new IllegalStateException("Execution environment must be initialized"); } else { String codeValue = code.apply(targetEnvironment); executeCodeImpl(codeValue); } } ); }