InheritDocProvider<PsiElement[]> (InheritDocProvider<PsiDocTag> i, boolean dropFirst) { return new InheritDocProvider<>() { @Override public Pair<PsiElement[], InheritDocProvider<PsiElement[]>> getInheritDoc() { Pair<PsiDocTag, InheritDocProvider<PsiDocTag>> pair = i.getInheritDoc(); if (pair == null) return null; PsiElement[] elements; PsiElement[] rawElements = pair.first.getDataElements(); if (dropFirst && rawElements.length > 0) { elements = new PsiElement[rawElements.length - 1]; System.arraycopy(rawElements, 1, elements, 0, elements.length); } else { elements = rawElements; } return Pair.create(elements, mapProvider(pair.second, dropFirst)); } @Override public PsiClass getElement() { return i.getElement(); } }; }