code: function(elementA, elementB, opt) {
  
          opt = opt || {};
  
          var inbound = opt.inbound;
          var outbound = opt.outbound;
          if ((inbound === undefined) && (outbound === undefined)) {
              inbound = outbound = true;
          }
  
          var isNeighbor = false;
  
          this.getConnectedLinks(elementA, opt).forEach(function(link) {
  
              var source = link.source();
              var target = link.target();
  
              // Discard if it is a point.
              if (inbound && joint.util.has(source, 'id') && (source.id === elementB.id)) {
                  isNeighbor = true;
                  return false;
              }
  
              // Discard if it is a point, or if the neighbor was already added.
              if (outbound && joint.util.has(target, 'id') && (target.id === elementB.id)) {
                  isNeighbor = true;
                  return false;
              }
          });
  
          return isNeighbor;
      }
docs: Return `true` is `elementB` is a neighbor of `elementA`. Return `false` otherwise. `opt.deep` controls whether to take into account embedded elements as well. See `getNeighbors()` for more details. If `opt.outbound` is set to `true`, return `true` only if `elementB` is a successor neighbor. Similarly, if `opt.inbound` is set to `true`, return `true` only if `elementB` is a predecessor neighbor.