Ellipse extends AbstractShape { public Ellipse setCenter(Position position) { if (position == null) { this.center = null; } else if (this.center == null) { this.center = new Position(position); } else { this.center.set(position); } this.reset(); return this; } Ellipse();  Ellipse(ShapeAttributes attributes);  Ellipse(Position center, double majorRadius, double minorRadius);  Ellipse(Position center, double majorRadius, double minorRadius, ShapeAttributes attributes); Position getCenter(); Ellipse setCenter(Position position); double getMajorRadius(); Ellipse setMajorRadius(double radius); double getMinorRadius(); Ellipse setMinorRadius(double radius); double getHeading(); Ellipse setHeading(double degrees); boolean isExtrude(); Ellipse setExtrude(boolean extrude); boolean isFollowTerrain(); Ellipse setFollowTerrain(boolean followTerrain); int getMaximumIntervals(); Ellipse setMaximumIntervals(int numIntervals);  }
@Test public void testCenterSetterNonNull() { Position position = new Position(12, 34, 56); Position newPosition = new Position(24, 68, 10); double majorRadius = 1000; double minorRadius = 500; Ellipse ellipse = new Ellipse(position, majorRadius, minorRadius); ellipse.setCenter(newPosition); assertEquals("non-null center setter", newPosition, ellipse.center); }
@Test public void testCenterSetterNull() { Position newPosition = new Position(24, 68, 10); Ellipse ellipse = new Ellipse(); ellipse.setCenter(newPosition); assertEquals("null center setter", newPosition, ellipse.center); }
@Test public void testCenterSetterToNull() { Position position = new Position(12, 34, 56); double majorRadius = 1000; double minorRadius = 500; Ellipse ellipse = new Ellipse(position, majorRadius, minorRadius); ellipse.setCenter(null); assertEquals("set to null center setter", null, ellipse.center); }