Methods { public static String path(Method method) { var builder = new StringBuilder(); builder.append(method.getDeclaringClass().getCanonicalName()) .append('.') .append(method.getName()) .append('('); Type[] paramTypes = method.getGenericParameterTypes(); for (int i = 0; i < paramTypes.length; i++) { if (i > 0) builder.append(", "); builder.append(paramTypeName(paramTypes[i])); } builder.append(')'); return builder.toString(); }  static String path(Method method);  }
@Test void path() throws NoSuchMethodException { String path = Methods.path(MethodsTest.class.getDeclaredMethod("testMethod", String.class, Integer.class, Long.class)); assertThat(path).isEqualTo("core.framework.internal.reflect.MethodsTest.testMethod(String, Integer, Long)"); }