ScenarioSimulationXMLPersistence { public String extractVersion(String rawXml) { Matcher m = p.matcher(rawXml); if (m.find()) { return m.group(1); } throw new IllegalArgumentException("Impossible to extract version from the file"); } private  ScenarioSimulationXMLPersistence(); static void configureXStreamMappings(XStream toConfigure); static ScenarioSimulationXMLPersistence getInstance(); static String getCurrentVersion(); static String cleanUpUnusedNodes(String input); static double getColumnWidth(String expressionIdentifierName); String marshal(final ScenarioSimulationModel sc); ScenarioSimulationModel unmarshal(final String rawXml); ScenarioSimulationModel unmarshal(final String rawXml, boolean migrate); String migrateIfNecessary(String rawXml); String extractVersion(String rawXml); MigrationStrategy getMigrationStrategy(); void setMigrationStrategy(MigrationStrategy migrationStrategy);  }
@Test public void extractVersion() { String version = instance.extractVersion("<ScenarioSimulationModel version=\"1.0\" version=\"1.1\">"); assertEquals("1.0", version); }