void (@NotNull final Map<String, Long> trace, long time, int threshold) { final long tracedTime = trace.get("Gradle data obtained") + trace.get("Gradle project data processed") + trace.get("Data import total"); double percent = (double)tracedTime / time * 100; boolean condition = percent > threshold && percent < 100; if (!condition) { System.out.println("Trace counters: " + trace); } assertTrue(String.format("Test time [%d] traced time [%d], percentage [%.2f]", time, tracedTime, percent), condition); }