
import org.junit.Ignore;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import static org.junit.Assert.assertEquals;

public class BinarySearchTest {

    @Test
    public void findsAValueInAnArrayWithOneElement() {
        List<Integer> listOfUnitLength = Collections.singletonList(6);

        BinarySearch<Integer> sut = new BinarySearch<>(listOfUnitLength);

        assertEquals(0, sut.indexOf(6));
    }

    @Ignore("Remove to run test")
    @Test
    public void findsAValueInTheMiddleOfAnArray() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(3, sut.indexOf(6));
    }

    @Ignore("Remove to run test")
    @Test
    public void findsAValueAtTheBeginningOfAnArray() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(0, sut.indexOf(1));
    }

    @Ignore("Remove to run test")
    @Test
    public void findsAValueAtTheEndOfAnArray() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(6, sut.indexOf(11));
    }

    @Ignore("Remove to run test")
    @Test
    public void findsAValueInAnArrayOfOddLength() {
        List<Integer> sortedListOfOddLength = Collections.unmodifiableList(
                Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfOddLength);

        assertEquals(9, sut.indexOf(144));
    }

    @Ignore("Remove to run test")
    @Test
    public void findsAValueInAnArrayOfEvenLength() {
        List<Integer> sortedListOfEvenLength = Collections.unmodifiableList(
                Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfEvenLength);

        assertEquals(5, sut.indexOf(21));
    }

    @Ignore("Remove to run test")
    @Test
    public void identifiesThatAValueIsNotIncludedInTheArray() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(-1, sut.indexOf(7));
    }

    @Ignore("Remove to run test")
    @Test
    public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(-1, sut.indexOf(0));
    }

    @Ignore("Remove to run test")
    @Test
    public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() {
        List<Integer> sortedList = Collections.unmodifiableList(
                Arrays.asList(1, 3, 4, 6, 8, 9, 11)
        );

        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);

        assertEquals(-1, sut.indexOf(13));
    }

    @Ignore("Remove to run test")
    @Test
    public void nothingIsIncludedInAnEmptyArray() {
        List<Integer> emptyList = Collections.emptyList();

        BinarySearch<Integer> sut = new BinarySearch<>(emptyList);

        assertEquals(-1, sut.indexOf(1));
    }
}

@@ -389,34 +389,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -461,34 +461,37 @@
 ssertEquals(0, s
-ut
+earch
 .indexOf(6));%0A  
@@ -743,34 +743,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -817,18 +817,21 @@
 als(3, s
-ut
+earch
 .indexOf
@@ -1094,34 +1094,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -1168,18 +1168,21 @@
 als(0, s
-ut
+earch
 .indexOf
@@ -1439,34 +1439,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -1513,18 +1513,21 @@
 als(6, s
-ut
+earch
 .indexOf
@@ -1829,34 +1829,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -1914,18 +1914,21 @@
 als(9, s
-ut
+earch
 .indexOf
@@ -2228,34 +2228,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -2314,18 +2314,21 @@
 als(5, s
-ut
+earch
 .indexOf
@@ -2601,34 +2601,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -2668,34 +2668,37 @@
 sertEquals(-1, s
-ut
+earch
 .indexOf(7));%0A  
@@ -2971,34 +2971,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -3038,34 +3038,37 @@
 sertEquals(-1, s
-ut
+earch
 .indexOf(0));%0A  
@@ -3340,34 +3340,37 @@
 earch%3CInteger%3E s
-ut
+earch
  = new BinarySea
@@ -3407,34 +3407,37 @@
 sertEquals(-1, s
-ut
+earch
 .indexOf(13));%0A 
@@ -3629,18 +3629,21 @@
 teger%3E s
-ut
+earch
  = new B
@@ -3695,18 +3695,21 @@
 ls(-1, s
-ut
+earch
 .indexOf

rename variable