int (@NotNull Context<E> context, @Nullable ArrangementEntryWrapper<E> parentWrapper, @NotNull ArrangementEntryWrapper<E> targetWrapper, @Nullable ArrangementEntryWrapper<E> previousWrapper, @Nullable ArrangementEntryWrapper<E> nextWrapper) { final E target = targetWrapper.getEntry(); final E previous = previousWrapper == null ? null : previousWrapper.getEntry(); if (isTypeOf(target, END_SECTION) || isTypeOf(previous, START_SECTION)) { return 0; } final E next = nextWrapper == null ? null : nextWrapper.getEntry(); final E parentEntry = parentWrapper == null ? null : parentWrapper.getEntry(); final Language language = parentEntry instanceof LanguageAwareArrangementEntry ? ((LanguageAwareArrangementEntry)parentEntry).getLanguage() : null; final Rearranger<E> rearranger = context.getRearranger(language); if (next != null && isTypeOf(target, START_SECTION)) { return rearranger.getBlankLines(context.settings, parentEntry, previous, next); } return rearranger.getBlankLines(context.settings, parentEntry, previous, target); }