private static boolean isLastOfItsKind(@NotNull PsiElement element, boolean down) { return getSiblingOfType(element, down, element.getClass()) == null; }