OptionJuggle { public static OptionSet discardEOptions(OptionSet optionSet) { LOGGER.info("Removing inner only E options from the outer options"); OptionSet result = new OptionSet(); for (Option opt : optionSet.asSortedList()) { if (!allEOptions.contains(opt.getNumber())) { result.addOption(opt); } } return result; }  static OptionSet prepareUoptions(OptionSet options); static OptionSet prepareEoptions(OptionSet options); static OptionSet discardEOptions(OptionSet optionSet); static Request setFakeCodeRequest(Request request); static Request setRealCodeRequest(Request request, Code realCode); static Response setFakeCodeResponse(Response response); static Response setRealCodeResponse(Response response, ResponseCode realCode); static OptionSet merge(OptionSet eOptions, OptionSet uOptions);  }
@Test public void testDiscardEOptions() { OptionSet options = new OptionSet(); options.setAccept(accept); options.setIfNoneMatch(true); options.setMaxAge(maxAge); options.setUriHost(uri); OptionSet trimmed = OptionJuggle.discardEOptions(options); assertNotEquals(accept, trimmed.getAccept()); assertFalse(trimmed.hasIfNoneMatch()); assertNotEquals(maxAge, trimmed.getMaxAge()); assertEquals(uri, trimmed.getUriHost()); }