public static class NotReturnedExceptionMapper implements ResponseExceptionMapper<BookNotReturnedException> {
public BookNotReturnedException fromResponse(Response r) {
String status = r.getMetadata().getFirst("Status").toString();
if ("notReturned".equals(status)) {
return new BookNotReturnedException(status);
} else {
return null;
}
}