boolean (Rectangle aRectangle, Line2D aLine) { if (aLine == null || aRectangle == null) { return false; } return (!segmentOutsideRectangle(aRectangle, aLine)) && (!segmentInsideRectangle(aRectangle, aLine)); }