@@ -0,0 +1,1518 @@
+package anabalica.github.io.meowletters;%0A%0Aimport junit.framework.*;%0A%0Aimport java.util.ArrayList;%0A%0Aimport anabalica.github.io.meowletters.letters.Letter;%0Aimport anabalica.github.io.meowletters.letters.LetterChain;%0A%0A/**%0A * Test LetterChain class%0A *%0A * @author Ana Balica%0A */%0Apublic class LetterChainTest extends TestCase %7B%0A    protected LetterChain letterChain = new LetterChain();%0A    protected ArrayList%3CLetter%3E chain = new ArrayList%3CLetter%3E();%0A%0A    public void testIsValid() %7B%0A        // Test empty chain%0A        assertTrue(letterChain.isValid());%0A%0A        // Test chain with a single element%0A        chain.add(new Letter(%22K%22));%0A        letterChain.setChain(chain);%0A        assertTrue(letterChain.isValid());%0A%0A        // Test a very long chain%0A        chain.clear();%0A        String longChain = %22QWFPGJLUYARSTDHNEZXCVBKMWQFPGJLRSTDHNE%22;%0A        for (int i = 0; i %3C longChain.length(); i++) %7B%0A            chain.add(new Letter(Character.toString(longChain.charAt(i))));%0A        %7D%0A        assertFalse(letterChain.isValid());%0A%0A        // Test two consecutive elements%0A        chain.clear();%0A        chain.add(new Letter(%22G%22));%0A        chain.add(new Letter(%22H%22));%0A        assertTrue(letterChain.isValid());%0A%0A        // Test three non consecutive elements%0A        chain.add(new Letter(%22B%22));%0A        assertFalse(letterChain.isValid());%0A%0A        // Test circular chain elements%0A        chain.clear();%0A        chain.add(new Letter(%22Z%22));%0A        chain.add(new Letter(%22A%22));%0A        assertFalse(letterChain.isValid());%0A    %7D%0A%7D%0A

test LetterChain.isValid()