@@ -0,0 +1,1692 @@
+package algorithm.compression.huffman;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class HuffmanCodingTest %7B%0A%0A    @Test%0A    public void whenGeneratingCharFrequencyArrayThenReturnCorrect() %7B%0A        HuffmanCoding huffmanCoding = new HuffmanCoding();%0A        int%5B%5D charFrequency = huffmanCoding.generateCharFrequency(%22abcdaba%22);%0A        int%5B%5D expectedCharFrequency = new int%5B256%5D;%0A        expectedCharFrequency%5B97%5D = 3;%0A        expectedCharFrequency%5B98%5D = 2;%0A        expectedCharFrequency%5B99%5D = 1;%0A        expectedCharFrequency%5B100%5D = 1;%0A%0A        assertArrayEquals(expectedCharFrequency, charFrequency);%0A    %7D%0A%0A    @Test%0A    public void whenGeneratingAHuffmanTreeThenReturnCorrect() %7B%0A        HuffmanCoding huffmanCoding = new HuffmanCoding();%0A        int%5B%5D charFrequency = new int%5B256%5D;%0A        charFrequency%5B97%5D = 3;//a%0A        charFrequency%5B98%5D = 2;//b%0A        charFrequency%5B99%5D = 1;//c%0A        charFrequency%5B100%5D = 1;//d%0A        HuffmanNode tree = huffmanCoding.generateHuffmanTree(charFrequency);%0A%0A        assertEquals(7,tree.getFrequency());%0A        assertEquals('a',tree.getRight().getName());%0A        assertEquals('b',tree.getLeft().getRight().getName());%0A        assertEquals('c',tree.getLeft().getLeft().getRight().getName());%0A        assertEquals('d', tree.getLeft().getLeft().getLeft().getName());%0A    %7D%0A%0A    @Test%0A    public void whenEncodingStringThenReturnCorrect() %7B%0A        HuffmanCoding huffmanCoding = new HuffmanCoding();%0A        String encodedString = huffmanCoding.encodeString(%22the cat is under the table%22);%0A        assertEquals(%2200100010101101110011000111000011000011100110101011010100011100100010101100101100111100000010%22, encodedString);%0A    %7D%0A%7D

Add some huffman coding tests