DefaultParam implements Param { public String toString() { return new ToStringBuilder(this) .append("name", config.getName()) .append("value", value) .toString(); } DefaultParam(ParamConfig config, Collection<Object> value); Collection<Object> getValue(); ParamConfig getParamConfig(); String toString();  }
@Test public void toStringShouldReturnSomethingUsefull(){ when(paramConfig.getName()).thenReturn("name"); assertEquals("DefaultParam[name=name,value=[a, b]]", toTest.toString()); }