ChunkUtil { public String preChunkedContentId(String contentId) { if (!isChunkManifest(contentId)) { return contentId; } int end = contentId.indexOf(ChunksManifest.manifestSuffix); return contentId.substring(0, end); }  String preChunkedContentId(String contentId); boolean isChunkManifest(String contentId); boolean isChunk(String contentId);  }
@Test public void testPreChunkedContentId() throws Exception { String baseId = "baseId"; String fullId = baseId + ChunksManifest.manifestSuffix; doTestPreChunkedContentId(baseId, fullId); fullId = baseId; doTestPreChunkedContentId(baseId, fullId); fullId = baseId + ChunksManifest.chunkSuffix; doTestPreChunkedContentId(fullId, fullId); fullId = baseId + ChunksManifest.manifestSuffix + 9; doTestPreChunkedContentId(fullId, fullId); doTestPreChunkedContentId(null, null); }