### Question:
Utils { public static Status statusFromThrowable(Throwable t) { Status s = Status.fromThrowable(t); if (s.getCode() != Status.Code.UNKNOWN) { return s; } if (t instanceof ClosedChannelException) { ClosedChannelException extraT = new ClosedChannelException(); extraT.initCause(t); return Status.UNKNOWN.withDescription("channel closed").withCause(extraT); } if (t instanceof IOException) { return Status.UNAVAILABLE.withDescription("io exception").withCause(t); } if (t instanceof Http2Exception) { return Status.INTERNAL.withDescription("http2 exception").withCause(t); } return s; } private  Utils(); static Metadata convertHeaders(Http2Headers http2Headers); static Http2Headers convertClientHeaders(Metadata headers,
      AsciiString scheme,
      AsciiString defaultPath,
      AsciiString authority,
      AsciiString method,
      AsciiString userAgent); static Http2Headers convertServerHeaders(Metadata headers); static Metadata convertTrailers(Http2Headers http2Headers); static Http2Headers convertTrailers(Metadata trailers, boolean headersSent); static Status statusFromThrowable(Throwable t); static final AsciiString STATUS_OK; static final AsciiString HTTP_METHOD; static final AsciiString HTTP_GET_METHOD; static final AsciiString HTTPS; static final AsciiString HTTP; static final AsciiString CONTENT_TYPE_HEADER; static final AsciiString CONTENT_TYPE_GRPC; static final AsciiString TE_HEADER; static final AsciiString TE_TRAILERS; static final AsciiString USER_AGENT; static final Resource<EventLoopGroup> DEFAULT_BOSS_EVENT_LOOP_GROUP; static final Resource<EventLoopGroup> DEFAULT_WORKER_EVENT_LOOP_GROUP; }### Answer:
@Test public void testStatusFromThrowable() { Status s = Status.CANCELLED.withDescription("msg"); assertSame(s, Utils.statusFromThrowable(new Exception(s.asException()))); Throwable t; t = new ConnectTimeoutException("msg"); assertStatusEquals(Status.UNAVAILABLE.withCause(t), Utils.statusFromThrowable(t)); t = new Http2Exception(Http2Error.INTERNAL_ERROR, "msg"); assertStatusEquals(Status.INTERNAL.withCause(t), Utils.statusFromThrowable(t)); t = new Exception("msg"); assertStatusEquals(Status.UNKNOWN.withCause(t), Utils.statusFromThrowable(t)); }