### Question:
PipelineIdConverter implements ResponseIdConverter { @Override public Long getId(final BulkItemResponse response) { final String index = response.getIndex(); if (pipelineIndexName.equals(index)) { return ResponseIdConverter.super.getId(response); } if (index.startsWith(pipelineCodeIndexPrefix)) { final String id = Utils.last(Arrays.asList(index.split("-"))); return Long.parseLong(id); } throw new IllegalArgumentException( String.format("Cannot parse id for item {} index {}", response.getId(), index)); }  @Override Long getId(final BulkItemResponse response);  }### Answer:
@Test void shouldGetPipelineIdFromBulkItemResponse() { final BulkItemResponse response = getResponseForIndex(PIPELINE_INDEX_NAME); final Long id = idConverter.getId(response); assertNotNull(id); assertEquals(Long.parseLong(DOCUMENT_ID), (long) id); }
@Test void shouldGetPipelineCodeIdFromBulkItemResponse() { String indexName = PIPELINE_CODE_INDEX_NAME + "-" + DOCUMENT_ID; final BulkItemResponse response = getResponseForIndex(indexName); final Long id = idConverter.getId(response); assertNotNull(id); assertEquals(Long.parseLong(DOCUMENT_ID), (long) id); }
@Test void shouldFailGetPipelineIdFromBulkItemResponse() { final BulkItemResponse response = getResponseForIndex(PIPELINE_INDEX_NAME + "-" + DOCUMENT_ID); assertThrows(IllegalArgumentException.class, () -> idConverter.getId(response)); }