### Question:
DefaultDistributedNavigableSetService extends AbstractDistributedSetService<NavigableSet<E>, E> implements DistributedTreeSetService<E> { @Override public Serializer serializer() { return serializer; } DefaultDistributedNavigableSetService(); @Override Serializer serializer(); @Override E lower(E e); @Override E floor(E e); @Override E ceiling(E e); @Override E higher(E e); @Override E pollFirst(); @Override E pollLast(); @Override E first(); @Override E last(); @Override E subSetFirst(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetLast(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetLower(E e, E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetFloor(E e, E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetCeiling(E e, E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetHigher(E e, E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetPollFirst(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override E subSetPollLast(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override int subSetSize(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override void subSetClear(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override IteratorBatch<E> subSetIterate(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override IteratorBatch<E> subSetIterateDescending(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive); @Override IteratorBatch<E> iterateDescending();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testSnapshot() throws Exception { ServiceContext context = mock(ServiceContext.class); when(context.serviceType()).thenReturn(DistributedSetType.instance()); when(context.serviceName()).thenReturn("test"); when(context.serviceId()).thenReturn(PrimitiveId.from(1)); when(context.wallClock()).thenReturn(new WallClock()); Session session = mock(Session.class); when(session.sessionId()).thenReturn(SessionId.from(1)); DefaultDistributedNavigableSetService service = new DefaultDistributedNavigableSetService(); service.init(context); service.add("foo"); Buffer buffer = HeapBuffer.allocate(); service.backup(new DefaultBackupOutput(buffer, service.serializer())); service = new DefaultDistributedNavigableSetService(); service.restore(new DefaultBackupInput(buffer.flip(), service.serializer())); assertTrue(service.contains("foo")); }