@Test public void cannotIterateBeyondTheEndOfTheRegisteredAlternatives() throws Exception { try { empty().iterator().next(); fail("Iterator should not iterate over the end of the registered alternatives"); } catch (NoSuchElementException e) { assertThat(e.getMessage(),equalTo("No more alternatives are available")); } }
@Override public Iterator<Alternative> iterator() { return new AlternativeIterator(this.entries.iterator()); }
ImmutableAlternatives implements Alternatives { @Override public Iterator<Alternative> iterator() { return new AlternativeIterator(this.entries.iterator()); } }
ImmutableAlternatives implements Alternatives { @Override public Iterator<Alternative> iterator() { return new AlternativeIterator(this.entries.iterator()); } private  ImmutableAlternatives(final ImmutableList<Entry> entries); }
ImmutableAlternatives implements Alternatives { @Override public Iterator<Alternative> iterator() { return new AlternativeIterator(this.entries.iterator()); } private  ImmutableAlternatives(final ImmutableList<Entry> entries); @Override Iterator<Alternative> iterator(); @Override int size(); @Override boolean isEmpty(); @Override ImmutableAlternative alternative(int i); @Override ImmutableQuality quality(int i); @Override String toString(); }
ImmutableAlternatives implements Alternatives { @Override public Iterator<Alternative> iterator() { return new AlternativeIterator(this.entries.iterator()); } private  ImmutableAlternatives(final ImmutableList<Entry> entries); @Override Iterator<Alternative> iterator(); @Override int size(); @Override boolean isEmpty(); @Override ImmutableAlternative alternative(int i); @Override ImmutableQuality quality(int i); @Override String toString();  }