public void removeMapping(String name, boolean ifExists) {
        if (relationsStorage.removeMapping(name) != null) {
            listeners.forEach(TableListener::onTableChanged);
        } else if (!ifExists) {
            throw QueryException.error("Mapping does not exist: " + name);
        }
    }
@Test
    public void when_removesNonExistingMapping_then_throws() {
        // given
        String name = "name";

        given(relationsStorage.removeMapping(name)).willReturn(null);

        // when
        // then
        assertThatThrownBy(() -> catalog.removeMapping(name, false))
                .isInstanceOf(QueryException.class)
                .hasMessageContaining("Mapping does not exist: name");
        verifyNoInteractions(listener);
    }