SingleInputSemanticProperties implements SemanticProperties { @Override public int getForwardingSourceField(int input, int targetField) { if (input != 0) { throw new IndexOutOfBoundsException(); } for (Map.Entry<Integer, FieldSet> e : fieldMapping.entrySet()) { if (e.getValue().contains(targetField)) { return e.getKey(); } } return -1; } SingleInputSemanticProperties(); @Override FieldSet getForwardingTargetFields(int input, int sourceField); @Override int getForwardingSourceField(int input, int targetField); @Override FieldSet getReadFields(int input); void addForwardedField(int sourceField, int targetField); void addReadFields(FieldSet readFields); @Override String toString();  }
@Test(expected = IndexOutOfBoundsException.class) public void testAllForwardedSingleInputSemPropsInvalidIndex1() { SingleInputSemanticProperties sp = new SingleInputSemanticProperties.AllFieldsForwardedProperties(); sp.getForwardingSourceField(1, 0); }