}
@Test
public void shouldIndexTreeOfResources() {
Directory directory = Directory.create("src/org/foo", "org/foo");
File file = File.create("src/org/foo/Bar.java", "org/foo/Bar.java", Java.INSTANCE, false);
assertThat(index.index(directory)).isTrue();
assertThat(index.index(file, directory)).isTrue();
File fileRef = File.create("src/org/foo/Bar.java", "org/foo/Bar.java", null, false);
assertThat(index.getResource(fileRef).getKey()).isEqualTo("src/org/foo/Bar.java");
assertThat(index.getResource(fileRef).getDeprecatedKey()).isEqualTo("org/foo/Bar.java");
assertThat(index.getResource(fileRef).getLanguage().getKey()).isEqualTo("java");
assertThat(index.isIndexed(fileRef, true)).isTrue();
assertThat(index.isExcluded(fileRef)).isFalse();