public String decode(String codeWord) {
        if (codeWord != null) {
            decode = new StringBuilder();
            StringBuilder sum = new StringBuilder();
            String c;
            char l;
            int count = 0;
            for (int i = 0; i < codeWord.length()-1; i++) {
                switch (l=codeWord.charAt(i)) {
                    case 'A':
                        for (int j = 0; j < count; j++) {
                            decode.append(alphabet[0]);
                        }
                        sum.setLength(0);
                        break;

                    case 'B':
                        for (int j = 0; j < count; j++) {
                            decode.append(alphabet[1]);
                        }
                        sum.setLength(0);
                        break;
                        
                   default:
                        c = "" + l;
                        if(!c.isEmpty()){
                        sum.append(c);  
                        count = Integer.parseInt(sum.toString());
                        }
                        break;
                }
            }
            return decode.toString();
        } else {
            throw new IllegalArgumentException("Codeword  must not be null");
        }

    }