@Test
public void testIndexDefinitionsByName() {

    final JSITItemDefinition definition1 = mock(JSITItemDefinition.class);
    final JSITItemDefinition definition2 = mock(JSITItemDefinition.class);
    final JSITItemDefinition definition3 = mock(JSITItemDefinition.class);
    final String name1 = "name1";
    final String name2 = "name2";
    final String name3 = "name3";
    final List<JSITItemDefinition> list = Arrays.asList(definition1, definition2, definition3);
    when(definition1.getName()).thenReturn(name1);
    when(definition2.getName()).thenReturn(name2);
    when(definition3.getName()).thenReturn(name3);
    final Map<String, JSITItemDefinition> index = abstractKogitoDMNServiceSpy.indexDefinitionsByName(list);
    assertEquals(3, index.size());
    assertTrue(index.containsKey(name1));
    assertTrue(index.containsKey(name2));
    assertTrue(index.containsKey(name3));
    assertEquals(definition1, index.get(name1));
    assertEquals(definition2, index.get(name2));
    assertEquals(definition3, index.get(name3));
}