Step extends ResultMatch { public String returnNameWithArguments() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("<span class=\"parameter\">" + argument + "</span>")); } } return tmpName; }  List<ResultMatch> getBefore(); void setBefore(final List<ResultMatch> before); int getLine(); void setLine(final int line); String getName(); void setName(final String name); String returnNameWithArguments(); String returnNameWithArgumentPlaceholders(); String getKeyword(); void setKeyword(final String keyword); List<Row> getRows(); void setRows(final List<Row> rows); List<ResultMatch> getAfter(); void setAfter(final List<ResultMatch> after); DocString getDocString(); void setDocString(final DocString docString); long getTotalDuration(); String returnTotalDurationString(); String getUrlFriendlyName(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test public void returnNameWithArguments() { when(step.getName()).thenReturn("This is a name with an argument inside."); Result result = mock(Result.class); List<Argument> arguments = new ArrayList<>(); Argument argument = new Argument(); argument.setVal("argument"); arguments.add(argument); when(step.getArguments()).thenReturn(arguments); step.setResult(result); assertThat(step.returnNameWithArguments(), is("This is a name with an <span class=\"parameter\">argument</span> inside.")); }