public boolean nextTo(final Entity entity,final double step){
  final Rectangle2D thisArea=new Rectangle2D.Double(x - step,y - step,area.getWidth() + 2 * step,area.getHeight() + 2 * step);
  return thisArea.intersects(entity.getArea());
}

public boolean nextTo ( final Entity entity , final double step ) { final Rectangle2D thisArea = new Rectangle2D . Double ( x - step , y - step , area . getWidth ( ) + 2 * step , area . getHeight ( ) + 2 * step ) ; return thisArea . intersects ( entity . getArea ( ) ) ; }
checks whether the given entity is near this entity .
