private static final int[] euclidInv(int a, int b, int prevDiv)
private static int[] euclidInv(int a, int b, int prevDiv)
  private static final int[] euclidInv(int a, int b, int prevDiv)  {    if (b == 0)      throw new ArithmeticException("not invertible");    if (b == 1)	// Success:  values are indeed invertible!	// Bottom of the recursion reached; start unwinding.	return new int[] { -prevDiv, 1 };    int[] xy = euclidInv(b, a % b, a / b);	// Recursion happens here.    a = xy[0]; // use our local copy of 'a' as a work var    xy[0] = a * -prevDiv + xy[1];    xy[1] = a;    return xy;  }