### Question:
ArchetypeValidator { void checkInternalReferences() { checkInternalReferences(archetype.getDefinition(), RmPath.ROOT); } ArchetypeValidator(RmModel rmModel, Archetype archetype); void validate(); List<AqlValidationError> getErrors();  }### Answer:
@Test public void testCheckInternalReferences() throws Exception { Archetype sourceArchetype = parseArchetype("adl15/validation/adl-test-car.use_node.test.adls"); Archetype useNodeArchetype = new ArchetypeFlattener().flatten(null, sourceArchetype); ArchetypeValidator validator = new ArchetypeValidator(rmModel, useNodeArchetype); List<AqlValidationError> expected = new ArrayList<>(); expected.add(new AqlValidationError(AqlValidationError.Level.ERROR, "Internal reference at /wheels[at0005]/parts refers to an unknown target: /engine[at0001]/parts[at0002]")); expected.add(new AqlValidationError(AqlValidationError.Level.ERROR, "Internal reference at /wheels[at0006]/parts has a different rmType than target /wheels[at0001]/parts[at0002]: WHEEL!=WHEEL_PART")); validator.checkInternalReferences(); assertThat(validator.getErrors()).containsOnly(expected.toArray()); }