### Question:
EntityResource extends AbstractBrooklynRestResource implements EntityApi { @Override public Response rename(String application, String entity, String newName) { Entity entityLocal = brooklyn().getEntity(application, entity); entityLocal.setDisplayName(newName); return status(Response.Status.OK).build(); }  @Override List<EntitySummary> list(final String application); @Override EntitySummary get(String application, String entityName); @Override List<EntitySummary> getChildren(final String application, final String entity); @Override List<EntitySummary> getChildrenOld(String application, String entity); @Override Response addChildren(String applicationToken, String entityToken, Boolean start, String timeoutS, String yaml); @Override List<TaskSummary> listTasks(String applicationId, String entityId); @Override TaskSummary getTask(final String application, final String entityToken, String taskId); @SuppressWarnings("unchecked") @Override List<Object> listTags(String applicationId, String entityId); @Override Response getIcon(String applicationId, String entityId); @Override Response rename(String application, String entity, String newName); @Override Response expunge(String application, String entity, boolean release); @Override List<EntitySummary> getDescendants(String application, String entity, String typeRegex); @Override Map<String, Object> getDescendantsSensor(String application, String entity, String sensor, String typeRegex); @Override List<LocationSummary> getLocations(String application, String entity); @Override String getSpec(String applicationToken, String entityToken);  }### Answer:
@Test public void testRename() throws Exception { try { ClientResponse response = client().resource(entityEndpoint + "/name") .queryParam("name", "New Name") .post(ClientResponse.class); HttpAsserts.assertHealthyStatusCode(response.getStatus()); Assert.assertTrue(entity.getDisplayName().equals("New Name")); } finally { entity.setDisplayName("simple-ent"); } }