Star2D implements Shape { @Override public boolean contains(double x, double y) { return starShape.contains(x, y); } Star2D(double x, double y,
                  double innerRadius, double outerRadius,
                  int branchesCount); void setInnerRadius(double innerRadius); void setX(double x); void setY(double y); void setOuterRadius(double outerRadius); void setBranchesCount(int branchesCount); double getX(); double getY(); double getInnerRadius(); double getOuterRadius(); int getBranchesCount(); @Override Rectangle getBounds(); @Override Rectangle2D getBounds2D(); @Override boolean contains(double x, double y); @Override boolean contains(Point2D p); @Override boolean intersects(double x, double y, double w, double h); @Override boolean intersects(Rectangle2D r); @Override boolean contains(double x, double y, double w, double h); @Override boolean contains(Rectangle2D r); @Override PathIterator getPathIterator(AffineTransform at); @Override PathIterator getPathIterator(AffineTransform at, double flatness);  }
@Test public void testContains() { assertTrue(star.contains(new Point2D.Double(50,50))); assertTrue(star.contains(new Rectangle(45,45,10,10))); assertTrue(star.contains(45,45,10,10)); assertTrue(star.contains(55,55)); }