private static boolean isWithinBounds(VisualPosition targetPosition,VisualPosition startPosition,VisualPosition endPosition){
  return targetPosition.line >= startPosition.line && targetPosition.line <= endPosition.line && targetPosition.column >= startPosition.column && targetPosition.column <= endPosition.column;
}

private static boolean isWithinBounds ( VisualPosition targetPosition , VisualPosition startPosition , VisualPosition endPosition ) { return targetPosition . line >= startPosition . line && targetPosition . line <= endPosition . line && targetPosition . column >= startPosition . column && targetPosition . column <= endPosition . column ; }
allows to answer if particular visual position belongs to visual rectangle identified by the given visual position of its top - left and bottom - right corners .
