### Question:
StaticFactoryConverter extends AbstractConverter { static void sort(final List<Method> candidates) { Collections.sort(candidates, new Comparator<Method>() { public int compare(final Method a, final Method b) { int av = grade(a); int bv = grade(b); return (a.getName().compareTo(b.getName()) + (av - bv)); } }); } StaticFactoryConverter(final Class type, final Method method); static StaticFactoryConverter editor(final Class type);  }### Answer:
@Test public void testSort() throws Exception { final List<Method> candidates = StaticFactoryConverter.getCandidates(Green.class); StaticFactoryConverter.sort(candidates); final List<Method> expected = from(Green.class, "valueOf", "valueOfObject", "valueOfString", "newGreen", "newInstance", "newObject", "decode", "decodeGreen", "decodeObject", "decodeString", "forGreen", "forObject", "forString", "of", "ofGreen", "ofObject", "ofString", "parse", "parseGreen", "parseObject", "parseString", "from", "fromString", "fromGreen", "fromObject", "create", "createGreen", "createObject", "createString", "compile", "compileGreen", "compileObject", "compileString", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "w", "x", "y", "z", "get", "getGreen", "getInstance", "getObject", "getString" ); assertEquals(names(expected), names(candidates)); }