UnexpectedStatusCodeException extends IOException { public int getStatusCode() { return mStatusCode; } UnexpectedStatusCodeException(int statusCode, String message); int getStatusCode(); @Override String toString();  }
@Test public void getStatusCode() { UnexpectedStatusCodeException e = new UnexpectedStatusCodeException(100, ""); assertThat(e.getStatusCode(), is(100)); }