ManifestHeaderProcessor { public static Map<String,String> parseFilter(String filter) { Map<String,String> result; if (filter.startsWith("(&")) { result = parseFilterList(filter.substring(2, filter.length()-1)); } else { result = parseFilterList(filter); } return result; }  static List<String> split(String value, String delimiter); static List<NameValuePair> parseExportString(String s); static List<NameValuePair> parseExportList(List<String> list); static Map<String, Map<String, String>> parseImportString(String s); static List<GenericMetadata> parseCapabilityString(String s); static List<GenericMetadata> parseRequirementString(String s); static NameValuePair parseBundleSymbolicName(String s); static VersionRange parseVersionRange(String s); static VersionRange parseVersionRange(String s, boolean exactVersion); static String generateFilter(Map<String, String> attribs); static String generateFilter(String type, String name,
      Map<String, String> attribs); static Map<String,String> parseFilter(String filter); static final String NESTED_FILTER_ATTRIBUTE; }
@Test public void testParseFilter() { Map<String,String> attrs = ManifestHeaderProcessor.parseFilter("(package=com.ibm.test)"); assertEquals("com.ibm.test", attrs.get("package")); attrs = ManifestHeaderProcessor.parseFilter("(&(package=com.ibm.test)(attr=value))"); assertEquals("com.ibm.test", attrs.get("package")); assertEquals("value", attrs.get("attr")); assertEquals(2, attrs.size()); attrs = ManifestHeaderProcessor.parseFilter("(&(version>=1.0.0))"); assertEquals("1.0.0", attrs.get("version")); attrs = ManifestHeaderProcessor.parseFilter("(&(version>=1.0.0)(version<=2.0.0))"); assertEquals("[1.0.0,2.0.0]", attrs.get("version")); attrs = ManifestHeaderProcessor.parseFilter("(&(version>=1.0.0)(version<=2.0.0)(!(version=1.0.0)))"); assertEquals("(1.0.0,2.0.0]", attrs.get("version")); attrs = ManifestHeaderProcessor.parseFilter("(&(!(version=2.0.0))(!(version=1.0.0))(version>=1.0.0)(version<=2.0.0))"); assertEquals("(1.0.0,2.0.0)", attrs.get("version")); }