### Question:
ContributionServiceHelper { public static List<Version> extractVersionObjects(ArrayList listVersions, CompositionFormat format) { List<Version> versionsList = new LinkedList<>(); switch (format) { case JSON: for (Object version : listVersions) { try { String json = JacksonUtil.getObjectMapper().writeValueAsString(version); RMObject versionRmObject = new CanonicalJson().unmarshal(json, RMObject.class); if (versionRmObject instanceof Version) { versionsList.add((Version) versionRmObject); } else { throw new IllegalArgumentException("Wrong input. At least one VERSION in this contribution is invalid."); } } catch (JsonProcessingException e) { throw new IllegalArgumentException("Error while processing given json input: " + e.getMessage()); } } break; case XML: default: throw new UnexpectedSwitchCaseException(format); } return versionsList; }  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 extractVersionObjects() { Map<String, Object> splitContent = extractVersionObjectsPreStep(ContributionTestDataCanonicalJson.ONE_ENTRY_COMPOSITION.getStream(), CompositionFormat.JSON); Object versionsContent = splitContent.get("versions"); List<Version> versions = ContributionServiceHelper.extractVersionObjects((ArrayList) versionsContent, CompositionFormat.JSON); extractVersionObjectsCheck(versions, 1); Map<String, Object> splitContent2 = extractVersionObjectsPreStep(ContributionTestDataCanonicalJson.TWO_ENTRIES_COMPOSITION.getStream(), CompositionFormat.JSON); Object versionsContent2 = splitContent2.get("versions"); List<Version> versions2 = ContributionServiceHelper.extractVersionObjects((ArrayList) versionsContent2, CompositionFormat.JSON); extractVersionObjectsCheck(versions2, 2); }