@Test
public void failsWhenUnableToParsePattern() {

    NodeMapper mapper = new NodeMapper();
    Node input = Node.from("[");
    Assertions.assertThrows(
            NodeDeserializationException.class,
            () -> mapper.deserialize(input, Pattern.class));
    // Shy away from a specific message assertion in case the message ever changes between JDK versions.
}