private static int defaultMaximumDistance(final Entity entity,final int x,final int y){
  int manhattan=Math.abs(x - entity.getX()) + Math.abs(y - entity.getY());
  return Math.max(2 * manhattan,40);
}

private static int defaultMaximumDistance ( final Entity entity , final int x , final int y ) { int manhattan = Math . abs ( x - entity . getX ( ) ) + Math . abs ( y - entity . getY ( ) ) ; return Math . max ( 2 * manhattan , 40 ) ; }
get a reasonable maximum path length to search
