public static long findAndVerifyWindowGrace(final GraphNode graphNode) {
        return findAndVerifyWindowGrace(graphNode, "");
    }
@Test
    public void shouldFailIfThereIsNoGraceAncestor() {
        // doesn't matter if this ancestor is stateless or stateful. The important thing it that there is
        // no grace period defined on any ancestor of the node
        final StatefulProcessorNode<String, Long> gracelessAncestor = new StatefulProcessorNode<>(
            "stateful",
            new ProcessorParameters<>(
                () -> new Processor<String, Long, String, Long>() {

                    @Override
                    public void process(final Record<String, Long> record) {}

                },
                "dummy"
            ),
            (StoreFactory) null
        );

        final ProcessorGraphNode<String, Long> node = new ProcessorGraphNode<>("stateless", null);
        gracelessAncestor.addChild(node);

        try {
            GraphGraceSearchUtil.findAndVerifyWindowGrace(node);
            fail("should have thrown.");
        } catch (final TopologyException e) {
            assertThat(e.getMessage(), is("Invalid topology: Window close time is only defined for windowed computations. Got [stateful->stateless]."));
        }
    }