import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;

import java.io.IOException;
import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;

public class TextBuddyTest {
	
	private static final String FILE_NAME = "mytextfile.txt";

	@BeforeClass
	public static void initialize() throws IOException {
		TextBuddy tb = new TextBuddy(FILE_NAME);
		tb.checkFileStatus();
	}

	@Test
	public void testSortEmpty() {
		TextBuddy.clearText();
		
		List<String> list = TextBuddy.sortText();
		assertThat(list.isEmpty(), is(true));
	}
	
	@Test
	public void testSort() {
		TextBuddy.addText("cccc");
		TextBuddy.addText("aaaa");
		TextBuddy.addText("bbbb");
		
		List<String> list = TextBuddy.sortText();
		
		// Not empty.
		assertThat(list.isEmpty(), is(false));
		
		// Check sorted.
		assertEquals("[aaaa, bbbb, cccc]", list.toString());
	}

}

@@ -591,21 +591,50 @@
 testSort
+1
 () %7B%0A
+%09%09TextBuddy.clearText();%0A%09%09%0A
 %09%09TextBu
@@ -841,16 +841,16 @@
 sorted.%0A
-
 %09%09assert
@@ -898,12 +898,349 @@
 g());%0A%09%7D
+%0A%09%0A%09@Test%0A%09public void testSort2() %7B%0A%09%09TextBuddy.clearText();%0A%09%0A%09%09TextBuddy.addText(%22CCCC%22);%0A%09%09TextBuddy.addText(%22aaaa%22);%0A%09%09TextBuddy.addText(%22xxxx%22);%0A%09%09%0A%09%09List%3CString%3E list = TextBuddy.sortText();%0A%09%09%0A%09%09// Not empty.%0A%09%09assertThat(list.isEmpty(), is(false));%0A%09%09%0A%09%09// Check sorted.%0A%09%09assertEquals(%22%5Baaaa, CCCC, xxxx%5D%22, list.toString());%0A%09%7D
 %0A%0A%7D%0A

Test case with uppercase and lowercase combination.