public void addForwardedField(int input, int sourceField, int targetField) {

        Map<Integer, FieldSet> fieldMapping;

        if (input != 0 && input != 1) {
            throw new IndexOutOfBoundsException();
        } else if (input == 0) {
            fieldMapping = this.fieldMapping1;
        } else {
            fieldMapping = this.fieldMapping2;
        }

        if (isTargetFieldPresent(targetField, fieldMapping)) {
            throw new InvalidSemanticAnnotationException(
                    "Target field " + targetField + " was added twice to input " + input);
        }

        FieldSet targetFields = fieldMapping.get(sourceField);
        if (targetFields != null) {
            fieldMapping.put(sourceField, targetFields.addField(targetField));
        } else {
            fieldMapping.put(sourceField, new FieldSet(targetField));
        }
    }
@Test
    void testAddForwardedFieldsTargetTwice1() {

        assertThatThrownBy(
                        () -> {
                            DualInputSemanticProperties sp = new DualInputSemanticProperties();
                            sp.addForwardedField(0, 0, 2);
                            sp.addForwardedField(0, 1, 2);
                        })
                .isInstanceOf(SemanticProperties.InvalidSemanticAnnotationException.class);
    }