CallOptionsUtil { static CallOptions putRequestParamsDynamicHeaderOption( CallOptions callOptions, String requestParams) { if (callOptions == null || requestParams.isEmpty()) { return callOptions; } Map<Key<String>, String> dynamicHeadersOption = callOptions.getOption(DYNAMIC_HEADERS_CALL_OPTION_KEY); dynamicHeadersOption = ImmutableMap.<Key<String>, String>builder() .putAll(dynamicHeadersOption) .put(REQUEST_PARAMS_HEADER_KEY, requestParams) .build(); return callOptions.withOption(DYNAMIC_HEADERS_CALL_OPTION_KEY, dynamicHeadersOption); } private  CallOptionsUtil(); static ResponseMetadataHandler getMetadataHandlerOption(CallOptions callOptions);  }
@Test(expected = NullPointerException.class) public void testPutAndGetHeaderOptionNull() throws Exception { CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, null); }