ErrorTrait extends StringTrait { public int getDefaultHttpStatusCode() { return isClientError() ? 400 : 500; } ErrorTrait(String value, SourceLocation sourceLocation);  ErrorTrait(String value); int getDefaultHttpStatusCode(); boolean isClientError(); boolean isServerError(); static final ShapeId ID; }
@Test public void returnsDefaultStatusCodes() { ErrorTrait a = new ErrorTrait("client", SourceLocation.NONE); ErrorTrait b = new ErrorTrait("server", SourceLocation.NONE); assertEquals(400, a.getDefaultHttpStatusCode()); assertEquals(500, b.getDefaultHttpStatusCode()); }