description.appendText("links to self");
}
@Override
public boolean matchesSafely(final T item) {
final HasLinkToSelf initialRepr = (HasLinkToSelf) item; // no easy
// way to do
// this with
// Hamcrest
// when
try {
final RestfulResponse<T> followedResp = client.followT(initialRepr.getSelf());
// then
final T repr2 = followedResp.getEntity();
final HasLinkToSelf repr2AsLinksToSelf = (HasLinkToSelf) repr2;
return initialRepr.getSelf().equals(repr2AsLinksToSelf.getSelf());
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
};