Int2ObjectMap<CharSequence> (@NotNull Constants.CaptureKey key) { TextMateCapture[] realCaptures = myCaptures.get(key); if (realCaptures == null) { return null; } Int2ObjectMap<CharSequence> captures = new Int2ObjectOpenHashMap<>(realCaptures.length); for (int group = 0; group < myCaptures.get(key).length; group++) { TextMateCapture capture = realCaptures[group]; if (capture != null) { captures.put(group, capture instanceof TextMateCapture.Name ? ((TextMateCapture.Name)capture).getName() : ""); } } return captures; }