Unable to view the contained after parsing ExplanationOfBenefit

Created ExplanationOfBenefit object which have organization in the contained list. When I parse the object using FhirContext.forR4(). I don’t see the contained list in the json string.

Creating ExplanationOfBenefit object:
Organization organization = new Organization();
organization.setId(“o1”);
explanationOfBenefit.getContained().add(organization);

Parsing
FhirContext.forR4().newJsonParser().encodeResourceToString(explanationOfBenefit)

output:
{
“resourceType”: “ExplanationOfBenefit”,
“id”: “100101A0000000”
}
expected
{ “resourceType”: “ExplanationOfBenefit”,
“contained”: [{
“resourceType”: “Organization”,
“id”: “o1”,
}],
“id”: “100101A0000000”
}

I can’t tell. what software are you using here?

I am using these two jar
compile ‘ca.uhn.hapi.fhir:hapi-fhir-base:4.0.3’
compile ‘ca.uhn.hapi.fhir:hapi-fhir-structures-r4:4.0.3’