public void testProperties() {
// Tests various properties of calculations with complex numbers. Some
// special cases are tested here.
// both numbers are 0.
checkProperties(new Complex(0, 0), new Complex(0, 0));
// one number is zero, the other an arbitrary real number
checkProperties(new Complex(15, 0), new Complex(0, 0));
checkProperties(new Complex(0, 0), new Complex(2, 0));
// one number is zero, the other an arbitrary imaginary number
checkProperties(new Complex(0, 0), new Complex(0, 3));
checkProperties(new Complex(0, 5), new Complex(0, 0));
// one number is zero, the other an arbitrary complex number
checkProperties(new Complex(0, 0), new Complex(2, 6));
checkProperties(new Complex(8, 13), new Complex(0, 0));
// one number is one, the other zero
checkProperties(new Complex(1, 0), new Complex(0, 0));
checkProperties(new Complex(0, 0), new Complex(1, 0));
// both numbers are one
checkProperties(new Complex(1, 0), new Complex(1, 0));
checkProperties(new Complex(1, 0), new Complex(1, 0));
// one number is one, the other an arbitrary real number
checkProperties(new Complex(1, 0), new Complex(46, 0));
checkProperties(new Complex(-98, 0), new Complex(1, 0));
// one number is one, the other an arbitrary imaginary number
checkProperties(new Complex(1, 0), new Complex(0, 211));
checkProperties(new Complex(0, -32), new Complex(1, 0));
// one number is one, the other an arbitrary complex number
checkProperties(new Complex(1, 0), new Complex(2, -7));
checkProperties(new Complex(-1, 5), new Complex(1, 0));
// one number is i, the other zero
checkProperties(new Complex(0, 1), new Complex(0, 0));
checkProperties(new Complex(0, 0), new Complex(0, 1));
// both numbers are i
checkProperties(new Complex(0, 1), new Complex(0, 1));
checkProperties(new Complex(0, 1), new Complex(0, 1));
// one number is i, the other an arbitrary real number
checkProperties(new Complex(0, 1), new Complex(42, 0));
checkProperties(new Complex(-23, 0), new Complex(0, 1));
// one number is i, the other an arbitrary imaginary number
checkProperties(new Complex(0, 1), new Complex(0, 15));
checkProperties(new Complex(0, -8), new Complex(0, 1));
// one number is i, the other an arbitrary complex number
checkProperties(new Complex(0, 1), new Complex(-6, 48));
checkProperties(new Complex(19, -1), new Complex(0, 1));
}