}
@Test
public void testFieldRemoval() throws URISyntaxException {
String field = "urn:the.field:used.for.this.Test";
ValueFactory vf = getValueFactory();
Representation rep = createRepresentation(null);
// Test removal for References
String strRef = "urn:testValue";
rep.addReference(field, strRef);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.removeReference(field, strRef);
assertFalse(asCollection(rep.getFieldNames()).contains(field));
Reference ref = vf.createReference("urn:testValue2");
rep.add(field, ref);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.remove(field, ref);
assertFalse(asCollection(rep.getFieldNames()).contains(field));
// test removal for texts (with and without language)
String strText = "test text";
String strTextLang = "en";
rep.addNaturalText(field, strText, strTextLang);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.removeNaturalText(field, strText, strTextLang);
assertFalse(asCollection(rep.getFieldNames()).contains(field));
String strTextNoLang = "test text without lang";
rep.addNaturalText(field, strTextNoLang);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.removeNaturalText(field, strTextNoLang);
assertFalse(asCollection(rep.getFieldNames()).contains(field));
// there is also the possibility to explicitly parse null as language
// could internally case differences however externally this is the same
rep.addNaturalText(field, strTextNoLang, (String) null);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.removeNaturalText(field, strTextNoLang, (String) null);
assertFalse(asCollection(rep.getFieldNames()).contains(field));
Text text = vf.createText("Das ist ein Text zum testen des Text Objektes", "de");
rep.add(field, text);
assertTrue(asCollection(rep.getFieldNames()).contains(field));
rep.remove(field, text);
assertFalse(asCollection(rep.getFieldNames()).contains(field));