Set<String> getTargetPackageIdentifiers(JavaClass javaClass) {
        ImmutableSet.Builder<String> result = ImmutableSet.builder();
        for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) {
            result.addAll(getPackageIdentifiersFromComponentOf(target));
        }
        return result.build();
    }
@Test
    public void rejects_class_not_contained_in_any_component() {
        JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder)
                .component("SomeComponent").withStereoTypes("..someStereotype.")
                .write());
        JavaClass classNotContained = importClassWithContext(Object.class);

        assertThatThrownBy(
                () -> javaClassDiagramAssociation.getTargetPackageIdentifiers(classNotContained)
        )
                .isInstanceOf(NoSuchElementException.class);
    }