UriFieldValue extends StringFieldValue { @Override public void assign(Object obj) { if (obj instanceof URI) { obj = obj.toString(); } super.assign(obj); } UriFieldValue();  UriFieldValue(String value); @Override void assign(Object obj); @Override DataType getDataType(); @Override void deserialize(Field field, FieldReader reader);  }
@Test public void requireThatURICanBeAssigned() { UriFieldValue value = new UriFieldValue(); String uri = "http: value.assign(URI.create(uri)); assertEquals(uri, value.getWrappedValue()); }