### Question:
EntryPosition { public synchronized boolean advance(long lssn, long entryId) { if (lssn == this.lssn) { if (entryId <= this.entryId) { return false; } this.entryId = entryId; return true; } else if (lssn > this.lssn) { this.lssn = lssn; this.entryId = entryId; return true; } else { return false; } } EntryPosition(long lssn, long entryId); synchronized long getLogSegmentSequenceNumber(); synchronized long getEntryId(); synchronized boolean advance(long lssn, long entryId); @Override String toString();  }### Answer:
@Test public void testAdvance() { EntryPosition position = new EntryPosition(9L, 99L); checkPosition(position, 9L, 99L); assertFalse(position.advance(8L, 100L)); checkPosition(position, 9L, 99L); assertFalse(position.advance(9L, 98L)); checkPosition(position, 9L, 99L); assertFalse(position.advance(9L, 99L)); checkPosition(position, 9L, 99L); assertTrue(position.advance(9L, 100L)); checkPosition(position, 9L, 100L); assertTrue(position.advance(10L, 0L)); checkPosition(position, 10L, 0L); }