### Question:
FindLoop { public int indexOf(int[] data, int el) { int index = -1; for (int i = 0; i < data.length; i++) { if (data[i] == el) { index = i; break; } } return index; }  int indexOf(int[] data, int el);  }### Answer:
@Test public void ifMassivOfSixElementsFindIndexContainsEight() { int[] data = {1, 15, 14, 8, 22}; FindLoop loop = new FindLoop(); int result = loop.indexOf(data, 8); assertThat(result, is(3)); }
@Test public void ifMassivHasNotAFindNomber() { int[] data = {1, 3, 4}; FindLoop loop = new FindLoop(); int result = loop.indexOf(data, 5); assertThat(result, is(-1)); }