boolean (@NotNull ActionChangeRange other, boolean preferBefore, boolean isInverted) { int adjustment = other.getNewLength() - other.getOldLength(); if (preferBefore) { if (moveRight(other, adjustment)) { return true; } if (moveLeft(other, adjustment, isInverted)) { return true; } } else { if (moveLeft(other, adjustment, isInverted)) { return true; } if (moveRight(other, adjustment)) { return true; } } return false; }