### Question:
Attribute { public static String removeToken(String attribute, String remove, String separator) { if (attribute == null || remove == null || separator == null) { return attribute; } StringTokenizer tokenizer = new StringTokenizer(attribute, separator); StringBuilder sb = new StringBuilder(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); if (!token.isEmpty() && !token.equals(remove)) { if (sb.length() <= 0) { sb.append(token); } else { sb.append(separator + token); } } } return sb.toString(); }  static ComponentTag setClass(ComponentTag tag, String className); static ComponentTag addClass(ComponentTag tag, String className); static ComponentTag removeClass(ComponentTag tag, String className); static boolean hasClass(ComponentTag tag, String className); static ComponentTag addAttribute(ComponentTag tag, String attribute); static ComponentTag addAttribute(ComponentTag tag, String attribute, String value); static ComponentTag addAttribute(ComponentTag tag, String attribute, boolean value); static ComponentTag addAttribute(ComponentTag tag, String attribute, int value); static ComponentTag removeAttribute(ComponentTag tag, String attribute); static boolean hasAttribute(ComponentTag tag, String attribute); static String getAttribute(ComponentTag tag, String attribute); static ComponentTag setDataOptions(ComponentTag tag, String value); static ComponentTag addDataOptions(ComponentTag tag, String value); static ComponentTag removeDataOptions(ComponentTag tag, String value); static boolean hasDataOptions(ComponentTag tag, String value); static String removeToken(String attribute, String remove, String separator);  }### Answer:
@Test public void testRemoveToken() { String data1 = "foo bar baz"; String sep1 = " "; String result1 = Attribute.removeToken(data1, "foo", sep1); assertEquals("bar baz", result1); String result2 = Attribute.removeToken(data1, "bar", sep1); assertEquals("foo baz", result2); String result3 = Attribute.removeToken(data1, "baz", sep1); assertEquals("foo bar", result3); String result4 = Attribute.removeToken(data1, "hello", sep1); assertEquals("foo bar baz", result4); String result5 = Attribute.removeToken(data1, null, sep1); assertEquals("foo bar baz", result5); String data2 = "foo;bar;baz;"; String sep2 = ";"; String result6 = Attribute.removeToken(data2, "foo", sep2); assertEquals("bar;baz", result6); }