String regionCode = metadata.getId();
PhoneMetadataCollection outMetadataCollection = new PhoneMetadataCollection();
outMetadataCollection.addMetadata(metadata);
FileOutputStream outputForRegion = new FileOutputStream(filePrefix + "_" + regionCode);
ObjectOutputStream out = new ObjectOutputStream(outputForRegion);
outMetadataCollection.writeExternal(out);
out.close();
}
Map<Integer, List<String>> countryCodeToRegionCodeMap =
BuildMetadataFromXml.buildCountryCodeToRegionCodeMap(metadataCollection);