### Question:
StreamIndices { public static List<String> getEvenIndexedStrings(String[] names) { List<String> evenIndexedNames = IntStream.range(0, names.length) .filter(i -> i % 2 == 0) .mapToObj(i -> names[i]) .collect(Collectors.toList()); return evenIndexedNames; }  static List<String> getEvenIndexedStrings(String[] names); List<String> getEvenIndexedStringsVersionTwo(List<String> names); static List<Indexed<String>> getEvenIndexedStrings(List<String> names); static List<Indexed<String>> getOddIndexedStrings(List<String> names); static List<String> getOddIndexedStrings(String[] names); static List<String> getOddIndexedStringsVersionTwo(String[] names);  }### Answer:
@Test public void whenCalled_thenReturnListOfEvenIndexedStrings() { String[] names = {"Afrim", "Bashkim", "Besim", "Lulzim", "Durim", "Shpetim"}; List<String> expectedResult = Arrays.asList("Afrim", "Besim", "Durim"); List<String> actualResult = StreamIndices.getEvenIndexedStrings(names); assertEquals(expectedResult, actualResult); }
@Test public void whenCalled_thenReturnListOfEvenIndexedStringsVersionTwo() { String[] names = {"Afrim", "Bashkim", "Besim", "Lulzim", "Durim", "Shpetim"}; List<String> expectedResult = Arrays.asList("Afrim", "Besim", "Durim"); List<String> actualResult = StreamIndices.getEvenIndexedStrings(names); assertEquals(expectedResult, actualResult); }
@Test public void givenList_whenCalled_thenReturnListOfEvenIndexedStrings() { List<String> names = Arrays.asList("Afrim", "Bashkim", "Besim", "Lulzim", "Durim", "Shpetim"); List<Indexed<String>> expectedResult = Arrays .asList(Indexed.index(0, "Afrim"), Indexed.index(2, "Besim"), Indexed .index(4, "Durim")); List<Indexed<String>> actualResult = StreamIndices.getEvenIndexedStrings(names); assertEquals(expectedResult, actualResult); }