Utils { static OWLDatatype ensureDatatype(final OWLDataRange r) { if (!r.isOWLDatatype()) { throw new UnsupportedICException("Data ranges not supported: " + r); } if (!r.asOWLDatatype().isBuiltIn()) { throw new UnsupportedICException("Only built in datatypes are supported: " + r); } return r.asOWLDatatype(); } private  Utils();   }
@Test public void testSucceedOnDatatype() { Utils.ensureDatatype(f.getOWLDatatype(XSDVocabulary.STRING.getIRI())); }
@Test public void testFailOnDataRange() { assertThrows(UnsupportedICException.class, () -> Utils.ensureDatatype( f.getOWLDatatypeRestriction(f.getIntegerOWLDatatype(), f.getOWLFacetRestriction(OWLFacet.MAX_LENGTH, 10)))); }