Antenna { public static Antenna omni(double x0, double y0) { return new Antenna(0, 0, 200e-3, 0.01, 0, x0, y0); } Antenna();  Antenna(double eccentricity, double lobes, double p0, double r0, double theta0, double x0, double y0); static Antenna omni(double x0, double y0); static Antenna shotgun(double x0, double y0, double theta0, double gainDB); void setPower(double p0, double r0); double power(double x, double y); double antennaGain(double theta); void setLobes(int lobes); long getId(); double distance(double x, double y); ObjectNode toJSONObject();  }
@Test public void testOmni() throws Exception { Random cx = new Random(); for (int i = 0; i < 20; i++) { double x = cx.nextDouble() * 20; double y = cx.nextDouble() * 20; Antenna ax = Antenna.omni(x, y); ax.setPower(100, 0.01); checkInvariants(ax, x, y); } }