### Question:
JavaSourceParser { public static Map<String, String[]> methodToParamNamesMap( String javaSrcFile, Class<?> clazz) { Map<String, String[]> map = new HashMap<String, String[]>(); try { JavaDocBuilder builder = new JavaDocBuilder(); builder.addSource(new File(javaSrcFile)); JavaClass jc = builder.getClassByName(clazz.getName()); JavaMethod methods[] = jc.getMethods(); for(JavaMethod method: methods) { if (method.isPublic() && !method.isStatic()) { String methodName = method.getName(); String[] paramNames = getParameterNames(method); map.put(methodName, paramNames); } } } catch (IOException e) { s_logger.log(Level.WARNING, "Failed to parse source file: " + javaSrcFile, e); } return map; }  static Map<String, String[]> methodToParamNamesMap(
			String javaSrcFile,
			Class<?> clazz);  }### Answer:
@Test public void testMethodToParamNamesMap() { Class<?> clazz = JavaSourceSample.class; String javaSrcFile = getTestSourcePath(clazz); Map<String, String[]> map = JavaSourceParser.methodToParamNamesMap(javaSrcFile, clazz); Assert.assertNotNull("Map should not be null", map); dump(map); Assert.assertTrue("Should have found 'dosomething' method", map.containsKey("dosomething")); Assert.assertTrue("Should have found 'getVersionId' method", map.containsKey("getVersionId")); String[] initParams = map.get("init"); Assert.assertNotNull("Should have gotten init params", initParams); Assert.assertEquals("logger", initParams[0]); Assert.assertEquals("level", initParams[1]); }