### Question:
Snapshot { public static Snapshot parse(Stream stream, String name) { Snapshot snapshot = new Snapshot(); snapshot.stream = stream; int idx = name.indexOf("_"); snapshot.date = ISODateTimeFormat.dateTimeParser().withOffsetParsed() .parseDateTime(name.substring(idx + 1)); snapshot.nr = Integer.parseInt(name.substring(0, idx)); return snapshot; } Snapshot();  Snapshot(int nr, DateTime date, Stream stream); Path getSnapshotDir(); String getSnapshotName(); @Override String toString(); static Snapshot parse(Stream stream, String name); static final Comparator<Snapshot> COMPARATOR_NR; public int nr; public DateTime date; public Stream stream; public UUID senderStreamId; }### Answer:
@Test public void testParse() throws Exception { Stream stream = new Stream(); Snapshot snapshot = Snapshot.parse(stream, name); assertEquals(4, snapshot.nr); assertEquals(date, snapshot.date); assertSame(stream, snapshot.stream); }