import java.io.*;

public class TestSphere{

  public static void useColoredSphere() {
    ColoredSphere ball = 
          new ColoredSphere(java.awt.Color.white);
    ball.setRadius(5.0);
    System.out.println("The ball diameter is " +
                        ball.diameter());
    System.out.println("The ball color is " + 
                      ball.getColor());
    // other code here...
  }  // end useColorSphere
 
  public static void testEquals() {
    Sphere sphere1 = new Sphere();
    Sphere sphere2 = sphere1;
    if (sphere1.equals(sphere2)) {
      System.out.println("sphere1 and sphere2 are the " +
                         "same object");
    }
    else {
      System.out.println("sphere1 and sphere2 are " +
                     "different objects");
    }  // end if
    
	 Sphere sphere4 = new Sphere(2.0);
    Sphere sphere3 = new Sphere(2.0);
    if (sphere4.equals(sphere3)) {
      System.out.println("sphere4 and sphere3 have " +
                         "the same radius");
    }
    else {
      System.out.println("sphere4 and sphere3 have " +                      "different radii");
    }  // end if

  } // end testEquals
 
  public static void main(String args[]) {
    // unitSphere radius is 1.0
    Sphere unitSphere = new Sphere();
    // mySphere radius is 5.1
    Sphere mySphere = new Sphere(5.1);

    unitSphere.displayStatistics();
	 System.out.println("\nChanging radius to 4.2");
    mySphere.setRadius(4.2);   // resets radius to 4.2
    System.out.println("The new diameter is " + mySphere.diameter());

    System.out.println("\nTesting ColoredSphere");
    useColoredSphere();
    
  }  // end main

} // end TestSphere
