public static String getId(DMNElementReference er) {
        String href = er.getHref();
        if (href.startsWith("#")) {
            return href.substring(1);
        } else {
            Definitions rootElement = getRootElement(er);
            String toRemove = String.format("%s#", rootElement.getNamespace());
            return href.replace(toRemove, "");
        }
    }
@Test
    void getId() {
        String localPart = "reference";
        DMNElementReference elementReference = new TDMNElementReference();
        elementReference.setHref(String.format("%s#%s", nameSpace, localPart));
        elementReference.setParent(parent);
        String retrieved = DMNCompilerImpl.getId(elementReference);
        assertThat(retrieved).isNotNull().isEqualTo(localPart);

        String expected = String.format("%s#%s", "http://a-different-namespace", localPart);
        elementReference.setHref(expected);
        retrieved = DMNCompilerImpl.getId(elementReference);
        assertThat(retrieved).isNotNull().isEqualTo(expected);
    }