code: public boolean areIntersected(IBond bond1, IBond bond2) {
          double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
          double y1 = 0, y2 = 0, y3 = 0, y4 = 0;
          //Point2D.Double p1 = null, p2 = null, p3 = null, p4 = null;
  
          x1 = bond1.getBegin().getPoint2d().x;
          x2 = bond1.getEnd().getPoint2d().x;
          x3 = bond2.getBegin().getPoint2d().x;
          x4 = bond2.getEnd().getPoint2d().x;
  
          y1 = bond1.getBegin().getPoint2d().y;
          y2 = bond1.getEnd().getPoint2d().y;
          y3 = bond2.getBegin().getPoint2d().y;
          y4 = bond2.getEnd().getPoint2d().y;
  
          Line2D.Double line1 = new Line2D.Double(new Point2D.Double(x1, y1), new Point2D.Double(x2, y2));
          Line2D.Double line2 = new Line2D.Double(new Point2D.Double(x3, y3), new Point2D.Double(x4, y4));
  
          if (line1.intersectsLine(line2)) {
              logger.debug("Two intersecting bonds detected.");
              return true;
          }
          return false;
      }
docs: Checks if two bonds cross each other.
  
  @param  bond1  Description of the Parameter
  @param  bond2  Description of the Parameter
  @return        Description of the Return Value