@CheckForNull
  public <M extends Message> M parseDelimitedFrom(Parser<M> parser, InputStream input) {
    try {
      return parser.parseDelimitedFrom(input);
    } catch (InvalidProtocolBufferException e) {
      throw new IllegalStateException("Can not parse message", e);
    }
  }
@Test
  public void parseDelimitedFrom_throws_ISE_on_error() throws Exception {
    try (FailureInputStream input = new FailureInputStream()) {
      assertThatThrownBy(() -> underTest.parseDelimitedFrom(Metadata.parser(), input))
        .isInstanceOf(IllegalStateException.class)
        .hasMessage("Can not parse message");
    }
  }