ResultSetFutureCall extends Call.Base<V> implements Call.Mapper<ResultSet, V> { public static boolean isOverCapacity(Throwable e) { return e instanceof QueryConsistencyException || e instanceof BusyConnectionException || e instanceof BusyPoolException; }  static boolean isOverCapacity(Throwable e);  }
@Test public void isOverCapacity() { InetSocketAddress sa = InetSocketAddress.createUnresolved("host", 9402); assertThat(ResultSetFutureCall.isOverCapacity(new BusyPoolException(() -> sa, 100))).isTrue(); assertThat(ResultSetFutureCall.isOverCapacity(new BusyConnectionException(() -> sa))).isTrue(); assertThat(ResultSetFutureCall.isOverCapacity(mock(QueryConsistencyException.class))).isTrue(); assertThat(ResultSetFutureCall.isOverCapacity( new IllegalStateException("Rejected execution"))).isFalse(); }