/** * Remove the most recently returned Link on the chain. * * @throws IllegalStateException is there is no most recently returned Link or if that Link was * already removed. */ public void remove() throws IllegalStateException { if (latest == null) { throw new IllegalStateException(); } if ((latest == origin) && latest.isChained()) { origin = null; } latest.remove(); latest = null; }