void (@NotNull Dimension size, @Nullable Dimension alternativeSize) { if (alternativeSize != null) { size.width = Math.max(size.width, alternativeSize.width); size.height = Math.max(size.height, alternativeSize.height); } }