### Question:
CheckmarxScanReportSupport { void fetchReportResult(CheckmarxAdapterContext context) throws AdapterException { ReportDetails details = context.getReportDetails(); try { RestOperations restTemplate = context.getRestOperations(); ResponseEntity<String> queueData = restTemplate .getForEntity(context.getAPIURL("reports/sastScan/" + context.getReportId()), String.class); String body = queueData.getBody(); if (body == null) { body = ""; } int index = body.indexOf("<?xml"); if (index > 0) { body = body.substring(index); } context.setResult(body); } catch (HttpStatusCodeException e) { if (HttpStatus.NOT_FOUND.equals(e.getStatusCode())) { details.notFound = true; return; } throw e; } }  void startFetchReport(CheckmarxAdapterContext context);  }### Answer:
@Test public void fetchReportResult__support_does_use_result_as_is_when_empty() throws Exception { CheckmarxAdapterContext context = prepareContent(""); supportToTest.fetchReportResult(context); verify(context).setResult(""); }
@Test public void fetchReportResult__support_does_remove_existing_byte_order_marks() throws Exception { CheckmarxAdapterContext context = prepareContent(UTF8_BOM+"<?xml bla"); supportToTest.fetchReportResult(context); verify(context).setResult("<?xml bla"); }
@Test public void fetchReportResult__support_does_remove_nothing_when_plain_xml() throws Exception { CheckmarxAdapterContext context = prepareContent("<?xml bla"); supportToTest.fetchReportResult(context); verify(context).setResult("<?xml bla"); }