### Question:
StructuredEmbeddingsExtractor { public Optional<StructuredEmbeddingsHolder> extract(String html) { int jsonStartIndex = magicHeaderLength(html); if (jsonStartIndex <= 0) { return Optional.empty(); } int jsonStopIndex = html.indexOf(JSON_STOP, jsonStartIndex); if (jsonStopIndex <= 0) { return Optional.empty(); } String json = html.substring(jsonStartIndex, jsonStopIndex).replace("&#x2d;", "-").replace("&amp;", "&"); String htmlParts = html.substring(jsonStopIndex + JSON_STOP.length()); JSONArray array; try { array = (JSONArray) new JSONParser(JSONParser.MODE_PERMISSIVE).parse(json); } catch (ParseException e) { log.error("Cannot parse StructuredEmbeddings JSON", e); return Optional.empty(); } StructuredEmbeddingsHolder embeddings = new StructuredEmbeddingsHolder(); for (int i = 0; i < array.size(); i++) { JSONObject object = (JSONObject) array.get(i); final Integer priorityOrder = (Integer) object.get("priorityOrder"); final ParsedStructuredEmbedding embedding = new ParsedStructuredEmbedding( (String) object.get("kind"), (String) object.get("name"), (String) object.get("type"), object.get("data"), (String) object.get("priority"), (priorityOrder == null ? 0 : priorityOrder.intValue()), extractHtml(htmlParts, i)); embeddings.getEmbeddings().add(embedding); } return Optional.of(embeddings); }  Optional<StructuredEmbeddingsHolder> extract(String html);  }### Answer:
@Test public void extractStringData_ShouldReturnTheFirstMatchingEmbeddingValue() { final String html = "" + "<!--StructuredEmbeddings_v1.0.0=[" + " {" + " }," + " {" + " \"data\":\"someStringValue\"," + " \"kind\":\"someKind\"" + " }," + " {" + " \"kind\":\"someKind\"" + " }" + "]-->"; final Optional<String> embedding = extract(html).extractStringData("someKind"); assertThat(embedding).isEqualTo(Optional.of("someStringValue")); }