private void mockLangHandler(HttpExchange httpExchange) throws IOException {
		assertContentType(httpExchange, CONTENT_TYPE_JSON);
		try {
			JsonArray langsResult = new JsonArray();
			for (int i = 0; i < supportedLanguageCount; i++) {
				JsonObject obj = new JsonObject();
				obj.addProperty("code", "%c%c".formatted('a' + i, 'a' + i));
				obj.addProperty("name", "Language " + i);
				JsonArray targets = new JsonArray();
				obj.add("targets", targets);
				langsResult.add(obj);
			}
			byte[] response = langsResult.toString().getBytes();

			httpExchange.getResponseHeaders().set(CONTENT_TYPE_HEADER, CONTENT_TYPE_JSON);
			httpExchange.sendResponseHeaders(HTTP_OK, response.length);
			httpExchange.getResponseBody().write(response);
		}
		finally {
			httpExchange.close();
		}
	}
Tests the LibreTranslateStringTranslationService by creating a mock HTTP server that responds
to the minimal requests the service needs.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/translate/libretranslate/LibreTranslateStringTranslationServiceTest.java