public static void main(String args[]){
        String notChaininput[] = {"geeks","king", "seeks", "sing","gik","kin"};
        String chainInput[] = {"king","gik","geeks", "seeks", "sing"};
        ChainWordsToFormCircle cwt = new ChainWordsToFormCircle();
        List<String> result = cwt.formCircle(chainInput);
        if(result.size() == 0){
            System.out.println("Not able to form a chain");
        }else{
            for(String chainNode : result){
                System.out.print(chainNode + " ");
            }
        }
    }
http://www.geeksforgeeks.org/given-array-strings-find-strings-can-chained-form-circle/
Test cases:
Empty input
1 element in input
no chain formed
chain formed
src/com/interview/recursion/ChainWordsToFormCircle.java