}
@Test
public void shouldAlwaysReturnTheDataOfTheLatestInput() {
// Given that an input has already been set:
List<TreePath> input1 = asList(new TreePath(new Object[]{"a", "b"}));
ITreePathBuilder builder = mock(ITreePathBuilder.class);
given(builder.build(input1)).willReturn(input1);
content = create(builder);
content.inputChanged(null, null, input1);
// When new input is set, gets the new root elements:
TreePath input2 = new TreePath(new Object[]{0, 1});
given(builder.build(input2)).willReturn(asList(input2));
content.inputChanged(null, input1, input2);
Object[] elements = content.getElements(input2);
// Then data from new input should be returned:
Object[] expected = new Object[]{input2.getFirstSegment()};
assertThat(elements, is(expected));
}