private static boolean segmentInsideRectangle(Rectangle aRectangle, Line2D aSegment) {
    return isWithin(aRectangle, aSegment.getP1()) && isWithin(aRectangle, aSegment.getP2());
  }
private static boolean segmentInsideRectangle(Rectangle aRectangle, Line2D aSegment)