### Question:
QNameConverter { public QName toModelValue(final String componentValue) { try { final List<String> matches = getRegexGroups(componentValue); if (matches.size() == 4) { final String namespace = matches.get(1); final String localPart = matches.get(2); final String prefix = matches.get(3); return new QName(namespace, localPart, prefix); } } catch (IllegalStateException ise) { } throw new IllegalArgumentException("Encoded form '" + componentValue + "' did not match '" + QNAME_DECODING_PATTERN + "'. Unable to convert to Model value."); } QNameConverter(); void setDMNModel(final DMNModelInstrumentedBase dmnModel); QName toModelValue(final String componentValue); String toWidgetValue(final QName modelValue);  }### Answer:
@Test public void testToModelValueWithCorrectlyEncodedValue() { final QName typeRef = converter.toModelValue(ENCODED_FEEL_DATE); assertEquals(QName.NULL_NS_URI, typeRef.getPrefix()); assertEquals("", typeRef.getNamespaceURI()); assertEquals(BuiltInType.DATE.getName(), typeRef.getLocalPart()); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue() { converter.toModelValue(""); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_NotEnoughBrackets() { converter.toModelValue("[][]"); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_UnclosedBrackets() { converter.toModelValue("[][[]"); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_UnopenBrackets() { converter.toModelValue("[]][]"); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_TextOutside() { converter.toModelValue("a[]b[]c[]d"); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_TextAtStart() { converter.toModelValue("a[][][]"); }
@Test(expected = IllegalArgumentException.class) public void testToModelValueWithIncorrectlyEncodedValue_TextAtEnd() { converter.toModelValue("[][][]d"); }