void () { Ref<IndentOptions> ref = Ref.create(); long fileLoadTime = TimeoutUtil.measureExecutionTime(() -> configureByFile(getFileNameWithExtension())); long detectingTime = TimeoutUtil.measureExecutionTime(() -> ref.set(detectIndentOptions(getVFile(), getEditor().getDocument()))); double ratio = (double)detectingTime / fileLoadTime; if (ratio > 0.3) { TeamCityLogger.error("Detecting indent have taken too much time proportionally to file read time " + ratio); } else { String msg = "Detecting indent relatively to file read " + ratio; TeamCityLogger.info(msg); System.out.println(msg); } //to ensure it worked as expected Assert.assertEquals("Detect indent mismatch", 2, ref.get().INDENT_SIZE); }