<T> LakosMetrics(Collection<MetricsComponent<T>> components, Function<T, Collection<T>> getDependencies) {
        MetricsComponentDependencyGraph<T> graph = MetricsComponentDependencyGraph.of(components, getDependencies);
        int cumulativeComponentDependency = components.stream()
                .mapToInt(component -> 1 + getNumberOfTransitiveDependencies(graph, component))
                .sum();
        this.cumulativeComponentDependency = cumulativeComponentDependency;
        this.averageComponentDependency = ((double) cumulativeComponentDependency) / components.size();
        this.relativeAverageComponentDependency = averageComponentDependency / components.size();
        this.normalizedCumulativeComponentDependency =
                ((double) cumulativeComponentDependency) / calculateCumulativeComponentDependencyOfBinaryTree(components.size());
    }
@Test
    public void lakos_metrics_of_packages() {
        JavaClasses classes = new ClassFileImporter().importPackagesOf(SomeTestClass1.class, SomeTestClass2.class);
        Set<JavaPackage> packages = ImmutableSet.of(
                classes.get(SomeTestClass1.class).getPackage(),
                classes.get(SomeTestClass2.class).getPackage());

        LakosMetrics metrics = ArchitectureMetrics.lakosMetrics(MetricsComponents.fromPackages(packages));

        assertMetrics(metrics, ExpectedMetrics.ccd(3).acd(1.5).racd(0.75).nccd(1.0));
    }