### Question:
PropertyElementDescriptors { void addDescriptor(Class<? extends Annotation> uiElementAnnotationType, ElementDescriptor descriptor, Class<?> pmoClass) { Validate.isTrue(pmoPropertyName.equals(descriptor.getPmoPropertyName()), String .format("Cannot add descriptor for property %s to PropertyElementDescriptors intended for property %s", descriptor.getPmoPropertyName(), pmoPropertyName)); if (descriptors.isEmpty()) { position = descriptor.getPosition(); } else { validateDynamicFieldDescriptor(descriptor, pmoClass); } descriptors.put(uiElementAnnotationType, descriptor); } PropertyElementDescriptors(String pmoPropertyName); int getPosition(); String getPmoPropertyName(); ElementDescriptor getDescriptor(Object pmo); void addAspect(List<LinkkiAspectDefinition> aspectDefs); boolean isNotEmpty(); List<LinkkiAspectDefinition> getAllAspects();  }### Answer:
@Test public void testAddDescriptor_DualDifferentPosition() { PropertyElementDescriptors descriptors = new PropertyElementDescriptors( TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITH_DIFFERENT_POSITION); Assertions.assertThrows(IllegalStateException.class, () -> { descriptors.addDescriptor(TestUIAnnotation.class, new ElementDescriptor(30, TestLinkkiComponentDefinition.create(() -> "TestUIAnnotation"), BoundProperty .of(TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITH_DIFFERENT_POSITION), Collections.emptyList()), TestPmo.class); descriptors.addDescriptor(AnotherTestUIAnnotation.class, new ElementDescriptor(31, TestLinkkiComponentDefinition.create(() -> "AnotherTestUIAnnotation"), BoundProperty .of(TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITH_DIFFERENT_POSITION), Collections.emptyList()), TestPmo.class); }); }
@Test public void testAddDescriptor_NoComponentTypeMethod() { PropertyElementDescriptors descriptors = new PropertyElementDescriptors( TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITHOUT_DIFFERENTIATOR); Assertions.assertThrows(IllegalStateException.class, () -> { descriptors.addDescriptor(TestUIAnnotation.class, new ElementDescriptor(30, TestLinkkiComponentDefinition.create(() -> "TestUIAnnotation"), BoundProperty .of(TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITHOUT_DIFFERENTIATOR), Collections.emptyList()), TestPmo.class); descriptors.addDescriptor(AnotherTestUIAnnotation.class, new ElementDescriptor(30, TestLinkkiComponentDefinition.create(() -> "AnotherTestUIAnnotation"), BoundProperty .of(TestPmo.ILLEGAL_DUAL_PMO_PROPERTY_WITHOUT_DIFFERENTIATOR), Collections.emptyList()), TestPmo.class); }); }
@Test public void testAddDescriptor_DifferentProperty() { PropertyElementDescriptors descriptors = new PropertyElementDescriptors(TestPmo.SINGLE_PMO_PROPERTY); Assertions.assertThrows(IllegalArgumentException.class, () -> { descriptors.addDescriptor(TestUIAnnotation.class, new ElementDescriptor(30, TestLinkkiComponentDefinition.create(() -> "TestUIAnnotation"), BoundProperty.of(TestPmo.DUAL_PMO_PROPERTY), Collections.emptyList()), TestPmo.class); }); }