### Question:
SnapshotFile { @VisibleForTesting static String parseName(String fileName) { return fileName.substring(0, fileName.lastIndexOf(PART_SEPARATOR, fileName.lastIndexOf(PART_SEPARATOR) - 1)); } SnapshotFile(File file, File temporaryFile); static boolean isSnapshotFile(File file); File file(); String name();  }### Answer:
@Test public void testParseSnapshotName() throws Exception { assertEquals("foo", SnapshotFile.parseName("foo-1-2.snapshot")); assertEquals("foo-bar", SnapshotFile.parseName("foo-bar-1-2.snapshot")); }