Buggy code:
public class GlobalState { private static final Logger log = Logger . getLogger ( APP_LOGGER_NAME ) ; private static String username ; private static boolean testMode ; private static long roundTripTime ; private static Node localServerNode ; private static Node bootstrapNode ; private static final Map < Node , List < String > > neighbors = new Hashtable < > ( ) ; private static final Map < Node , Integer > neighborCountList = new HashMap < > ( ) ; private static final List < String > localFiles = new ArrayList < String > ( ) ; private static final List < SearchRequest > searchRequestList = new Vector < > ( ) ; private static final Map < String , SearchResponse > searchResponseList = new HashMap < > ( ) ; private static final Map < String , Request > responsePendingList = new Hashtable < > ( ) ; private static SearchRequest currentSearchingRequest ; private static List < Node > registeredNodeList = new ArrayList < > ( ) ; private static Semaphore heartBeatMonitorLock = new Semaphore ( 1 ) ; private static boolean neighborUnreachable = false ; private static int receivedRequestCount = 0 ; private static int forwardedRequestCount = 0 ; private static int answeredRequestCount = 0 ; private static HeartBeatTask heartBeatTask ; private static HeartBeatMonitorTask heartBeatMonitorTask ; private static DatagramSocket socket ; private static Client client ; private static Server server ; public static SearchRequest getCurrentSearchingRequest ( ) { } public static void setCurrentSearchingRequest ( SearchRequest request ) { } public static DatagramSocket getSocket ( ) throws SocketException , UnknownHostException { } public static int getReceivedRequestCount ( ) { } public static int getForwardedRequestCount ( ) { } public static int getAnsweredRequestCount ( ) { } public static void incrementReceivedRequestCount ( ) { } public static void incrementForwardedRequestCount ( ) { } public static void incrementAnsweredRequestCount ( ) { } public static void setRegisteredNodeList ( ArrayList < Node > list ) { } public static void removeRegisteredNode ( Node node ) { } public static Node getRegisteredNode ( int index ) { } public static int getRegisteredNodeCount ( ) { } public static boolean isResponsePending ( Request request ) { } public static boolean isResponsePending ( String key ) { } public static void addResponsePendingRequest ( String key , Request request ) { } public static Request getResponsePendingRequest ( String key ) { } public static void removeResponsePendingRequest ( String key ) { } public static long getRoundTripTime ( ) { } public static void setRoundTripTime ( long roundTripTime ) { } public static Map < Node , List < String > > getNeighbors ( ) { } public static Node getLocalServerNode ( ) { } public static void setLocalServerNode ( Node localServerNode ) { } public static String getUsername ( ) { } public static void setUsername ( String username ) { } public static boolean isTestMode ( ) { } public static void setTestMode ( boolean testMode ) { } public static void addNeighbor ( Node node ) { } public static void removeNeighbor ( Node node ) { } public static FileIpMapping getFileIpMapping ( ) { } public static void addNeighborFiles ( Node node , List < String > files ) { } public static Client getClient ( ) { } public static Server getServer ( ) { } public static List < String > getLocalFiles ( ) { } public static void addLocalFile ( String file ) { } public static void rememberRequest ( SearchRequest request ) { } public static boolean isSearchRequestAlreadyProcessed ( SearchRequest request ) { } public static void forgetRequest ( SearchRequest request ) { } public static synchronized void updateNeighborCount ( Node neighbor , Integer count ) { } public static Map < Node , Integer > getNeighborCountList ( ) { } public static Node getBootstrapNode ( ) { } public static void setBootstrapNode ( Node bootstrapNode ) { } public static void acquireHeartBeatMonitorLock ( ) { } public static void releaseHeartBeatMonitorLock ( ) { } public static boolean isNeighborUnreachable ( ) { } public static void setNeighborUnreachable ( boolean neighborUnreachable ) { } public static void addSearchResponse ( SearchResponse searchResponse ) { if ( ! ( searchResponse . getFileList ( ) . isEmpty ( ) ) ) { String fileName = searchResponse . getFileList ( ) . get ( 0 ) ; SearchRequest lastRequest = GlobalState . getCurrentSearchingRequest ( ) ; if ( lastRequest == null ) { return ; } List < String > searchWords = Arrays . asList ( lastRequest . getQuery ( ) . toLowerCase ( ) . split ( "_" ) ) ; <START_BUG> List < String > nameWords = Arrays . asList ( lastRequest . getQuery ( ) . toLowerCase ( ) . split ( "_" ) ) ; <END_BUG> if ( nameWords . containsAll ( searchWords ) ) { if ( ! ( GlobalState . searchResponseList . containsKey ( searchResponse . getSenderNode ( ) . getIpaddress ( ) ) ) ) { GlobalState . searchResponseList . put ( searchResponse . getSenderNode ( ) . getIpaddress ( ) , searchResponse ) ; } } } } public static void clearResponseList ( ) { } public static Map < String , SearchResponse > getSearchResponseList ( ) { } public static void startHeartBeat ( ) { } }

Fix:
List < String > nameWords = Arrays . asList ( fileName . toLowerCase ( ) . split ( "_" ) ) ;