static Set<Dependency> tryCreateFromAccess(JavaAccess<?> access) {
        JavaClass originOwner = access.getOriginOwner();
        JavaClass targetOwner = access.getTargetOwner();
        ImmutableSet.Builder<Dependency> dependencies = ImmutableSet.<Dependency>builder()
                .addAll(createComponentTypeDependencies(originOwner, access.getOrigin().getDescription(), targetOwner, access.getSourceCodeLocation()));
        if (!originOwner.equals(targetOwner) && !targetOwner.isPrimitive()) {
            dependencies.add(new Dependency.FromAccess(access));
        }
        return dependencies.build();
    }
@Test
    public void convert_dependency_from_access() {
        JavaMethodCall call = simulateCall().from(getClass(), "toString").to(Object.class, "toString");

        Dependency dependency = getOnlyElement(Dependency.tryCreateFromAccess(call));

        assertThatConversionOf(dependency)
                .satisfiesStandardConventions()
                .isPossibleToSingleElement(JavaAccess.class, it -> assertThat(it).isEqualTo(call))
                .isPossibleToSingleElement(JavaMethodCall.class, it -> assertThat(it).isEqualTo(call));
    }