### Question:
ContributionServiceHelper { public static List<Version> parseVersions(String content, CompositionFormat format) { Map<String, Object> splitContent = splitContent(content, format); List<Version> versions = null; Object versionsContent = splitContent.get("versions"); if (versionsContent instanceof List) { versions = extractVersionObjects((ArrayList) versionsContent, format); } else { throw new IllegalArgumentException("Can't process input, possible malformed version payload"); } return versions; }  static Map<String, Object> splitContent(String content, CompositionFormat format); static List<Version> extractVersionObjects(ArrayList listVersions, CompositionFormat format); static RMObject unmarshalMapContentToRmObject(LinkedHashMap content, CompositionFormat format); static List<Version> parseVersions(String content, CompositionFormat format); static AuditDetails parseAuditDetails(String content, CompositionFormat format);  }### Answer:
@Test public void getVersions() throws IOException { InputStream stream = ContributionTestDataCanonicalJson.ONE_ENTRY_COMPOSITION.getStream(); assertNotNull(stream); String streamString = IOUtils.toString(stream, UTF_8); List<Version> versionsA = unmarshalMapContentToRmObjectPreStep(ContributionTestDataCanonicalJson.ONE_ENTRY_COMPOSITION.getStream(), CompositionFormat.JSON); List<Version> versionsB = ContributionServiceHelper.parseVersions(streamString, CompositionFormat.JSON); assertEquals(versionsA, versionsB); InputStream stream2 = ContributionTestDataCanonicalJson.TWO_ENTRIES_COMPOSITION.getStream(); assertNotNull(stream2); String streamString2 = IOUtils.toString(stream2, UTF_8); List<Version> versionsA2 = unmarshalMapContentToRmObjectPreStep(ContributionTestDataCanonicalJson.TWO_ENTRIES_COMPOSITION.getStream(), CompositionFormat.JSON); List<Version> versionsB2 = ContributionServiceHelper.parseVersions(streamString2, CompositionFormat.JSON); assertEquals(versionsA2, versionsB2); }