### Question:
EntityResourceReference extends AbstractResourceReference { @Override public String toString() { ToStringBuilder builder = new XWikiToStringBuilder(this); builder.appendSuper(super.toString()); builder.append("reference", getEntityReference()); builder.append("action", getAction()); builder.append("locale", getLocale()); return builder.toString(); } EntityResourceReference(EntityReference entityReference, EntityResourceAction action); EntityResourceAction getAction(); void setAction(EntityResourceAction action); EntityReference getEntityReference(); void setEntityReference(EntityReference entityReference); void setLocale(Locale locale); Locale getLocale(); void setRevision(String revision); String getRevision(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString(); static final ResourceType TYPE; }### Answer:
@Test public void toStringTest() { EntityReference entityReference = new DocumentReference("wiki", "space", "page"); EntityResourceReference reference = new EntityResourceReference(entityReference, EntityResourceAction.VIEW); assertEquals( "type = [entity], parameters = [], reference = [wiki:space.page], action = [view], locale = [<null>]", reference.toString()); }