return parts;
}
private InputStream wrapInJson(final List<DebugInfo> parts) throws IOException {
CircleStreamBuffer csb = new CircleStreamBuffer();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(csb.getOutputStream(), "UTF-8"));
JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer);
jsonStreamWriter.beginObject()
.name(parts.get(0).getName().toLowerCase(Locale.ROOT));
parts.get(0).appendJson(jsonStreamWriter);
jsonStreamWriter.separator()
.name(parts.get(1).getName().toLowerCase(Locale.ROOT));
parts.get(1).appendJson(jsonStreamWriter);
jsonStreamWriter.separator()
.name("server")
.beginObject()
.namedStringValueRaw("version", ODataDebugResponseWrapper.class.getPackage().getImplementationVersion());
for (final DebugInfo part : parts.subList(2, parts.size())) {
jsonStreamWriter.separator()
.name(part.getName().toLowerCase(Locale.ROOT));
part.appendJson(jsonStreamWriter);
}
jsonStreamWriter.endObject()
.endObject();
writer.flush();
csb.closeWrite();
return csb.getInputStream();
}