### Question:
MethodSpec extends FeatureSpec { public static MethodSpec createMethodSpec (String s){ MethodParseData d = new MethodParseData(); s = s.trim(); String src = s; s = parseInversion(s,d); int i = s.indexOf(('(')); if (i >= 0){ int j = s.lastIndexOf(')'); if (j > i){ d.sigSpec = s.substring(i, j+1); s = s.substring(0, i); } else { return null; } } parseTypeAndName(s,d); try { return new MethodSpec(src, d.typeSpec, d.nameSpec, d.sigSpec, d.matchInverted); } catch (IllegalArgumentException iax){ return null; } } MethodSpec(String rawSpec, String cls, String name, String argSig, boolean inverted); static MethodSpec createMethodSpec(String s); String toString(); BitSet getMarkedArgs(); boolean isMarkedArg(int idx); boolean matches(Object feature); boolean matches(MethodInfo mi); boolean matches(String clsName, String mthName); boolean matchesClass(String clsName);  }### Answer:
@Test public void testConstruction(){ String spec = "x.y.Foo.bar(java.lang.String,^float[])"; MethodSpec ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = "x.y.Foo+.*"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = "*.foo(^int, ^double)"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = "( ^int, ^double)"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = ".foo"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = ".(int)"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms != null); spec = "!java.*.*"; ms = MethodSpec.createMethodSpec(spec); System.out.println(ms); assertTrue(ms != null); spec = "java.*"; ms = MethodSpec.createMethodSpec(spec); System.out.println(ms); spec = "*.foo(^int, ^double"; ms = MethodSpec.createMethodSpec(spec); System.out.println(spec + " => " + ms); assertTrue(ms == null); }