RemoteBlobMetadata { public static boolean isSegment(Map<String, String> metadata) { return metadata != null && TYPE_SEGMENT.equals(metadata.get(METADATA_TYPE)); }  static HashMap<String, String> toSegmentMetadata(RemoteSegmentArchiveEntry indexEntry); static RemoteSegmentArchiveEntry toIndexEntry(Map<String, String> metadata, int length); static boolean isSegment(Map<String, String> metadata); static final String METADATA_TYPE; static final String METADATA_SEGMENT_UUID; static final String METADATA_SEGMENT_POSITION; static final String METADATA_SEGMENT_GENERATION; static final String METADATA_SEGMENT_FULL_GENERATION; static final String METADATA_SEGMENT_COMPACTED; static final String TYPE_SEGMENT; }
@Test public void isSegment() { assertTrue(RemoteBlobMetadata.isSegment(Collections.singletonMap("type", "segment"))); assertFalse(RemoteBlobMetadata.isSegment(Collections.singletonMap("type", "index"))); }