import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;

import com.hewgill.android.nzsldict.Dictionary;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.List;

import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

@RunWith(AndroidJUnit4.class)
@SmallTest
public class DictionaryAndroidUnitTest {
    private Dictionary mDictionary;
    private List<Dictionary.DictItem> mResults;

    @Before
    public void createDictionary() {
        mDictionary = new Dictionary(getInstrumentation().getTargetContext());
    }

    @After
    public void clearResults() {
        mResults = null;
    }

    @Test
    public void dictionary_getWordsContainsWords() {
        assertNotEquals(mDictionary.getWords().size(), 0);
    }

    @Test
    public void dictionary_getWordsExactMatchMainGloss() {
        mResults = mDictionary.getWords("Book");
        assertEquals(mResults.get(0).gloss, "book");
    }

    @Test
    public void dictionary_getWordsContainsMatchMainGlass() {
        mResults = mDictionary.getWords("las");
        assertEquals(mResults.get(0).gloss, "sunglasses");
    }

    @Test
    public void dictionary_getWordsExactMatchMaoriGloss() {
        mResults = mDictionary.getWords("ora");
        assertEquals(mResults.get(0).gloss, "alive, live, survive");
    }

    @Test
    public void dictionary_getWordsContainsMatchMaoriGloss() {
        mResults = mDictionary.getWords("orang");
        assertEquals(mResults.get(0).gloss, "politics");
    }

    @Test
    public void dictionary_getWordsExactSecondaryGloss() {
        mResults = mDictionary.getWords("nought");
        assertEquals(mResults.get(0).gloss, "zero");
    }

    @Test
    public void dictionary_getWordsContainsSecondaryGloss() {
        mResults = mDictionary.getWords("keep ou");
        assertEquals(mResults.get(0).gloss, "want nothing to do with");
    }
}

@@ -1175,32 +1175,34 @@
 ary_getWords
-Contains
+StartsWith
 MatchMainGla
@@ -1249,19 +1249,25 @@
 tWords(%22
+sung
 las
+se
 %22);%0A    
@@ -1320,32 +1320,216 @@
 asses%22);%0A    %7D%0A%0A
+%0A    @Test%0A    public void dictionary_getWordsContainsMatchMainGlass() %7B%0A        mResults = mDictionary.getWords(%22las%22);%0A        assertEquals(mResults.get(0).gloss, %22lasagna%22);%0A    %7D%0A%0A
     @Test%0A    pu
@@ -1878,16 +1878,205 @@
 s, %22
-politics
+medical%22);%0A    %7D%0A%0A    @Test%0A    public void dictionary_getWordsStartsWithMatchMaoriGloss() %7B%0A        mResults = mDictionary.getWords(%22Aorang%22);%0A        assertEquals(mResults.get(0).gloss, %22Feilding
 %22);%0A
@@ -2379,15 +2379,19 @@
 ds(%22
+avoid, 
 keep
- ou
 %22);%0A

Update tests asserting search matching