@Test public void formatsMethodWithArguments() throws Exception { Class<?> type = TestClass.class; Method method = type.getMethod("aMethod", String.class); List<?> arguments = Collections.singletonList("param"); FormattedMethod formatted = new FormattedMethod(type, method, arguments); String expected = "TestClass.aMethod(param)"; Assert.assertEquals(expected, formatted.toString()); }
@Override public String toString() { return String.format("%s.%s(%s)", type.getSimpleName(), method.getName(), formatArguments(arguments)); }
FormattedMethod { @Override public String toString() { return String.format("%s.%s(%s)", type.getSimpleName(), method.getName(), formatArguments(arguments)); } }
FormattedMethod { @Override public String toString() { return String.format("%s.%s(%s)", type.getSimpleName(), method.getName(), formatArguments(arguments)); } FormattedMethod(Class<?> type, Method method, List<?> arguments); }
FormattedMethod { @Override public String toString() { return String.format("%s.%s(%s)", type.getSimpleName(), method.getName(), formatArguments(arguments)); } FormattedMethod(Class<?> type, Method method, List<?> arguments); @Override String toString(); }
FormattedMethod { @Override public String toString() { return String.format("%s.%s(%s)", type.getSimpleName(), method.getName(), formatArguments(arguments)); } FormattedMethod(Class<?> type, Method method, List<?> arguments); @Override String toString();  }