### Question:
SecureRandomIntIdGenerator extends SecureRandomIdGenerator<Integer> { @Override public Integer generate() { return secureRandom.nextInt(limit); } SecureRandomIntIdGenerator();  SecureRandomIntIdGenerator(int limit); @Override Integer generate();  }### Answer:
@Test public void testDefaultLimit() { SecureRandomIntIdGenerator generator = new SecureRandomIntIdGenerator(); Integer value = generator.generate(); assertTrue(value >= 0); assertTrue(value < 65536); }
@Test public void testGenerate() throws Exception { int limit = 1000000; SecureRandomIntIdGenerator generator = new SecureRandomIntIdGenerator(limit); int amount = 100; for (int i = 0; i < amount; i++) { Integer value = generator.generate(); assertTrue(value >= 0); assertTrue(value < limit); } }