@Override
    @SuppressWarnings("unchecked") // compatibility is explicitly checked
    public <T> Set<T> convertTo(Class<T> type) {
        if (type.isAssignableFrom(getClass())) {
            return (Set<T>) Collections.singleton(this);
        }
        if (type.isAssignableFrom(Dependency.class)) {
            return (Set<T>) Dependency.tryCreateFromAccess(this);
        }
        return Collections.emptySet();
    }
@Test
    public void convertTo() {
        TestJavaAccess access = javaAccessFrom(importClassWithContext(String.class), "toString")
                .to(Object.class, "toString")
                .inLineNumber(11);

        assertThatConversionOf(access)
                .satisfiesStandardConventions()
                .isPossibleToSingleElement(Dependency.class, dependency -> {
                    assertThatDependency(dependency)
                            .matches(String.class, Object.class)
                            .hasDescription(access.getDescription());
                });
    }