static void filterProperties(Message message, Set<String> namesToClear) {
    List<Object> retainedProperties = messagePropertiesBuffer();
    try {
      filterProperties(message, namesToClear, retainedProperties);
    } finally {
      retainedProperties.clear(); // ensure no object references are held due to any exception
    }
  }
@Test void filterProperties_message_allTypes() throws JMSException {
    TextMessage message = newMessageWithAllTypes();
    message.setStringProperty("b3", "00f067aa0ba902b7-00f067aa0ba902b7-1");

    PropertyFilter.filterProperties(message, Collections.singleton("b3"));

    assertThat(message).isEqualToIgnoringGivenFields(newMessageWithAllTypes(), "processAsExpired");
  }