### Question:
RecordApi extends BaseProvider implements RecordProvider { @Override public void checkRecordExists(String id) throws OaiPmhException { ResponseEntity<String> response = getResponseForRecord(id); if (response == null) { throw new IdDoesNotExistException("Record with id '" + id + "' not found"); } }  @Override Record getRecord(String id); @Override void checkRecordExists(String id); @Override ListRecords listRecords(List<Header> identifiers); void close();  }### Answer:
@Test public void checkRecordExists() throws OaiPmhException { Mockito.doNothing().when(recordApi).checkRecordExists(TEST_RECORD_ID); recordApi.checkRecordExists(TEST_RECORD_ID); }
@Test(expected = IdDoesNotExistException.class) public void checkRecordExistsWithWrongIdentifier() throws OaiPmhException { Mockito.doThrow(new IdDoesNotExistException("INCORRECT/ID")).when(recordApi).checkRecordExists("INCORRECT/ID"); recordApi.checkRecordExists("INCORRECT/ID"); fail(); }