### Question:
Sequence implements Iterable<SequenceItem> { public SequenceItem getLastItem() { if (containedItems.isEmpty()) { throw new SequenceConstructionException("Sequence is empty!"); } return this.asList().get(this.size() - 1); } Sequence(int reservedSize, int uniqueIdentifier, String name); int getUniqueIdentifier(); String getName(); int size(); void add(SequenceItem p); List<SequenceItem> asList(); @NotNull @Override Iterator<SequenceItem> iterator(); SequenceItem getLastItem(); BayesianNetwork toBayesianNetwork();  }### Answer:
@Test(expected = SequenceConstructionException.class) public void itThrowsIfYouAskForTheLastItemButThereIsNone() { new Sequence(10, this.hashCode(), null).getLastItem(); }