TokenParser { static String parseString(String token, String defaultValue) { final String trimmedToken = token.trim(); if (isWildcard(trimmedToken)) { return defaultValue; } return trimmedToken; }  static int parseHex(String token, int defaultValue); static double parseDouble(String token, double defaultValue); static Color parseColor(String token, Color defaultValue); static boolean parseBoolean(String token, boolean defaultValue);  }
@Test public void testParseStringWithDefault() { assertEquals("hulperitz", TokenParser.parseString("hulperitz", "schnack")); assertEquals("bla", TokenParser.parseString(" bla ", "blo")); assertEquals("default", TokenParser.parseString("*", "default")); assertEquals("de-fault", TokenParser.parseString(" * ", "de-fault")); }
@Test public void testParseString(){ assertEquals("value", TokenParser.parseString("value")); assertEquals("hoppla", TokenParser.parseString(" hoppla ")); }