### Question:
RandomAccessPattern extends AbstractEternalAccessPattern { @Override public int next() { return rng.nextInt(upper); } RandomAccessPattern(int _upper); @Override int next();  }### Answer:
@Test public void test0() throws Exception { RandomAccessPattern p = new RandomAccessPattern(1); assertTrue(p.isEternal()); assertTrue(p.hasNext()); assertEquals(0, p.next()); assertTrue(p.isEternal()); assertTrue(p.hasNext()); assertEquals(0, p.next()); }