public long getCount(String word){
        AtomicLong l = map.get(word);
        if(l != null){
            return l.longValue();
        }
        return 0;
    }
Date 03/05/2015
@author tusroy

Write a program to count words. This program should be threadsafe.
Implement two apis 
1) void addWord(String word) -> increment count of this word
2) long getCount(String word) -> get count of this word

Solution
Keep a concurrent map. Key to this map should be word while value should be AtomicLong to update it
in threadsafe way

Test cases
One word updated by many threads
Many words updated by many threads

@Threadsafe
src/com/interview/multithreaded/CountingWord.java