@Test
public void testAddSourceFieldOffset() {

	SingleInputSemanticProperties semProps = new SingleInputSemanticProperties();
	semProps.addForwardedField(0, 1);
	semProps.addForwardedField(0, 4);
	semProps.addForwardedField(2, 0);
	semProps.addForwardedField(4, 3);
	semProps.addReadFields(new FieldSet(0,3));
	SemanticProperties offsetProps = SemanticPropUtil.addSourceFieldOffset(semProps, 5, 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 0).size() == 2);
	assertTrue(offsetProps.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(offsetProps.getForwardingTargetFields(0, 0).contains(4));
	assertTrue(offsetProps.getForwardingTargetFields(0, 1).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 2).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 2).contains(0));
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 4).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 4).contains(3));
	assertTrue(offsetProps.getReadFields(0).size() == 2);
	assertTrue(offsetProps.getReadFields(0).contains(0));
	assertTrue(offsetProps.getReadFields(0).contains(3));
	offsetProps = SemanticPropUtil.addSourceFieldOffset(semProps, 5, 3);
	assertTrue(offsetProps.getForwardingTargetFields(0, 0).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 1).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 2).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).size() == 2);
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).contains(1));
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).contains(4));
	assertTrue(offsetProps.getForwardingTargetFields(0, 4).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 5).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 5).contains(0));
	assertTrue(offsetProps.getForwardingTargetFields(0, 6).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 7).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 7).contains(3));
	assertTrue(offsetProps.getReadFields(0).size() == 2);
	assertTrue(offsetProps.getReadFields(0).contains(3));
	assertTrue(offsetProps.getReadFields(0).contains(6));
	semProps = new SingleInputSemanticProperties();
	SemanticPropUtil.addSourceFieldOffset(semProps, 1, 0);
	semProps = new SingleInputSemanticProperties();
	semProps.addForwardedField(0, 0);
	semProps.addForwardedField(1, 2);
	semProps.addForwardedField(2, 4);
	offsetProps = SemanticPropUtil.addSourceFieldOffset(semProps, 3, 2);
	assertTrue(offsetProps.getForwardingTargetFields(0, 0).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 1).size() == 0);
	assertTrue(offsetProps.getForwardingTargetFields(0, 2).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 2).contains(0));
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 3).contains(2));
	assertTrue(offsetProps.getForwardingTargetFields(0, 4).size() == 1);
	assertTrue(offsetProps.getForwardingTargetFields(0, 4).contains(4));
}