SesameAdapter implements Closeable, Wrapper { @Override public <T> T unwrap(Class<T> cls) throws OntoDriverException { if (cls.isAssignableFrom(this.getClass())) { return cls.cast(this); } else if (cls.isAssignableFrom(valueFactory.getClass())) { return cls.cast(valueFactory); } return connector.unwrap(cls); } SesameAdapter(Connector connector, DriverConfiguration configuration); @Override void close(); @Override boolean isOpen(); @Override T unwrap(Class<T> cls);  }
@Test void unwrapReturnsItselfWhenClassMatches() throws Exception { assertSame(adapter, adapter.unwrap(SesameAdapter.class)); }
@Test void unwrapReturnValueFactoryWhenItMatches() throws Exception { assertSame(vf, adapter.unwrap(ValueFactory.class)); }