boolean (final boolean horizontal, final GridConstraints constraints, final GridConstraints otherConstraints) { int start = constraints.getCell(!horizontal); int end = start + constraints.getSpan(!horizontal) - 1; int otherStart = otherConstraints.getCell(!horizontal); int otherEnd = otherStart + otherConstraints.getSpan(!horizontal) - 1; return start <= otherEnd && otherStart <= end; }