void (@NotNull EditorColorsScheme colorsScheme, @NotNull Color testColor, boolean needToBeReused) { assertNotNull(testColor); colorsScheme.setAttributes(RainbowHighlighter.RAINBOW_COLOR_KEYS[0], RainbowHighlighter.createRainbowAttribute(testColor)); final Color[] colors = RainbowHighlighter.testRainbowGenerateColors(colorsScheme); final double minimalColorDistance = 0.02; int i = 0; for (Color color : colors) { if (needToBeReused) { assertEquals(testColor, color); break; } else { assertTrue(i++ + ": " + testColor + " vs " + color, RainbowHighlighter.colorDistance01(testColor, color) >= minimalColorDistance); } } }