PlanningVariableDescriptor variableDescriptor = SelectorTestUtils.mockVariableDescriptor(
TestdataChainedEntity.class, "chainedObject");
when(variableDescriptor.isChained()).thenReturn(true);
ScoreDirector scoreDirector = mock(ScoreDirector.class);
TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
TestdataChainedEntity a1 = new TestdataChainedEntity("a1", a0);
TestdataChainedEntity a2 = new TestdataChainedEntity("a2", a1);
TestdataChainedEntity a3 = new TestdataChainedEntity("a3", a2);
TestdataChainedEntity a4 = new TestdataChainedEntity("a4", a3);
TestdataChainedAnchor b0 = new TestdataChainedAnchor("b0");
TestdataChainedEntity b1 = new TestdataChainedEntity("b1", b0);
TestdataChainedEntity b2 = new TestdataChainedEntity("b2", b1);
SelectorTestUtils.mockMethodGetTrailingEntity(scoreDirector, variableDescriptor,
new TestdataChainedEntity[]{a1, a2, a3, a4, b1, b2});