public void addRule(ElementSelector elementSelector, Supplier<Action> actionSupplier) {

        Supplier<Action> existing = rules.get(elementSelector);

        if (existing == null) {
            rules.put(elementSelector, actionSupplier);
        } else {
            throw new IllegalStateException(elementSelector.toString() + " already has an associated action supplier");
        }
    }
@Test
    public void smokeII() throws Exception {
        srs.addRule(new ElementSelector("a/b"), () -> new XAction());

        Exception e = assertThrows(IllegalStateException.class, () -> {
            srs.addRule(new ElementSelector("a/b"), () -> new YAction());
        });
        assertEquals("[a][b] already has an associated action supplier", e.getMessage());
    }