GrpcParser extends MessageProcessor implements RpcResponseParser { @Nullable static String service(String fullMethodName) { int index = fullMethodName.lastIndexOf('/'); if (index == -1 || index == 0) return null; return fullMethodName.substring(0, index); }  @Override void parse(RpcResponse response, TraceContext context, SpanCustomizer span);  }
@Test public void service() { assertThat(GrpcParser.service(METHOD_DESCRIPTOR.getFullMethodName())) .isEqualTo("helloworld.Greeter"); }
@Test public void service_malformed() { assertThat(GrpcParser.service("/")).isNull(); }