GqSetupFactory { public GqSetup generateSetup() { return new GqSetup(q, p, createGenerator()); } private  GqSetupFactory(BigInteger q, BigInteger p); static GqSetupFactory factory(int q, int p); static GqSetupFactory factory(BigInteger q, BigInteger p); GqSetup generateSetup();  }
@Test public void shouldReturnCorrectQandP() { GqSetup setup = factory.generateSetup(); assertEquals(BigInteger.valueOf(11), setup.q); assertEquals(BigInteger.valueOf(23), setup.p); }
@Test public void shouldReturnCorrectQandPOverAndOver() { GqSetup first = factory.generateSetup(); GqSetup second = factory.generateSetup(); assertTrue(first.q.equals(second.q)); assertTrue(first.p.equals(second.p)); }
@Test public void shouldReturnDifferentGenerators() { GqSetup first = factory.generateSetup(); GqSetup second = factory.generateSetup(); assertFalse(first.generator.equals(second.generator)); }