### Question:
SymbolPathParser { public static List<String> parse(String name) { if (StringUtils.isBlank(name)) { throw new IllegalArgumentException( "Symbol list must contain at least one symbol name!"); } if (name.indexOf(Namespace.NAMESPACE_DELIMITER) == -1) { List<String> list = new ArrayList<>(); list.add(name); return list; } return naiveParse(name); }  static List<String> parse(String name);  }### Answer:
@Test public void testNullString() { try { SymbolPathParser.parse(null); fail(); } catch (IllegalArgumentException e) { } }
@Test public void testJustSymbolNameNoPath() { List<String> list = SymbolPathParser.parse("bob"); List<String> expected = new ArrayList<>(); expected.add("bob"); assertListEqualOrdered(expected, list); }
@Test public void testSymbolPathGivenPathString() { List<String> list = SymbolPathParser.parse("aaa::bbb::bob"); List<String> expected = new ArrayList<>(); expected.add("aaa"); expected.add("bbb"); expected.add("bob"); assertListEqualOrdered(expected, list); }
@Test public void testCliArray() { List<String> list = SymbolPathParser.parse( "namespace::ta<cli::array<wchar_t ,2>^,class System::Text::Encoding ^ __ptr64>"); List<String> expected = new ArrayList<>(); expected.add("namespace"); expected.add("ta<cli::array<wchar_t ,2>^,class System::Text::Encoding ^ __ptr64>"); assertListEqualOrdered(expected, list); }
@Test public void testNamespaceInFunctionArgument() { List<String> list = SymbolPathParser.parse( "Foo7::Bar5(class Foo1d::Bar1,int)"); List<String> expected = new ArrayList<>(); expected.add("Foo7"); expected.add("Bar5(class Foo1d::Bar1,int)"); assertListEqualOrdered(expected, list); }
@Test public void testCliPinptrMSFTVersion_NaiveProcessing() { List<String> list = SymbolPathParser.parse("namespace::ta<cli::pin_ptr" + "<unsigned char * __ptr64,class System::Text::Encoding ^ __ptr64>"); List<String> expected = new ArrayList<>(); expected.add("namespace"); expected.add("ta<cli"); expected.add("pin_ptr<unsigned char * __ptr64,class System"); expected.add("Text"); expected.add("Encoding ^ __ptr64>"); assertListEqualOrdered(expected, list); }
@Test public void testTemplateMoreComplicated1() { String name = "E::F<class E::D::G<struct E::D::H<bool (__cdecl*const)" + "(enum C::B const &),0>,bool,enum C::B const &> >::" + "F<class E::D::G<struct E::D::H<bool (__cdecl*const)(enum C::B const &),0>," + "bool,enum C::B const &> ><class E::D::A<bool,enum C::B const &> >"; List<String> list = SymbolPathParser.parse(name); List<String> expected = new ArrayList<>(); expected.add("E"); expected.add("F<class E::D::G<struct E::D::H<bool (__cdecl*const)" + "(enum C::B const &),0>,bool,enum C::B const &> >"); expected.add("F<class E::D::G<struct E::D::H<bool (__cdecl*const)(enum C::B const &),0>," + "bool,enum C::B const &> ><class E::D::A<bool,enum C::B const &> >"); assertListEqualOrdered(expected, list); }