PackageReferenceListParser { protected PackageReference.SingleReference parseSingle(String specifier) { final String name; final Version version; final PackageReference.Relation relation; try { specifier = specifier.trim(); Matcher m = SPECIFIER_PATTERN.matcher(specifier); if (!m.matches()) { LOGGER.error("Illegal specifier pattern '" + specifier + "' in Packages, allowed: " + SPECIFIER_PATTERN); throw new IllegalArgumentException(I18N.getMessage("PackageReference.IllegalArgument") + ": " + specifier); } name = m.group(1); if (m.group(2) != null) { relation = PackageReference.Relation.getByTextualRepresentation(m.group(2)); version = Version.parse(m.group(3)); } else { version = null; relation = null; } } catch (IllegalStateException e) { throw new IllegalArgumentException(I18N.getMessage("PackageReference.IllegalArgument") + ": ", e); } return new PackageReference.SingleReference(name, relation, version); }  PackageReferenceList parse(String specifier);  }
@Test public void testParseSingle() throws Exception { final String input = "foo-data"; PackageReferenceList list = parse(input); assertSingle(list, 0, "foo-data"); }