Buggy code:
public class OverseerCollectionProcessorTest extends SolrTestCaseJ4 { private static final String ADMIN_PATH = "//admin//cores" ; private static final String COLLECTION_NAME = "mycollection" ; private static final String CONFIG_NAME = "myconfig" ; private static DistributedQueue workQueueMock ; private static ShardHandler shardHandlerMock ; private static ZkStateReader zkStateReaderMock ; private static ClusterState clusterStateMock ; private static SolrZkClient solrZkClientMock ; private final Map zkMap = new HashMap ( ) ; private final Set collectionsSet = new HashSet ( ) ; private OverseerCollectionProcessorTest . OverseerCollectionProcessorToBeTested underTest ; private Thread thread ; private Queue < QueueEvent > queue = new org . eclipse . jetty . util . BlockingArrayQueue < QueueEvent > ( ) ; private class OverseerCollectionProcessorToBeTested extends OverseerCollectionProcessor { private SolrResponse lastProcessMessageResult ; public OverseerCollectionProcessorToBeTested ( ZkStateReader zkStateReader , String myId , ShardHandler shardHandler , String adminPath , DistributedQueue workQueue ) { } @ Override protected SolrResponse processMessage ( ZkNodeProps message , String operation ) { } @ Override protected LeaderStatus amILeader ( ) { } } @ BeforeClass public static void setUpOnce ( ) throws Exception { } @ AfterClass public static void tearDownOnce ( ) { } @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } protected Set < String > commonMocks ( int liveNodesCount ) throws Exception { OverseerCollectionProcessorTest . workQueueMock . peek ( true ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { Object result ; while ( ( result = queue . peek ( ) ) == null ) { Thread . sleep ( 1000 ) ; } return result ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . workQueueMock . remove ( anyObject ( QueueEvent . class ) ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { queue . remove ( ( ( QueueEvent ) ( getCurrentArguments ( ) [ 0 ] ) ) ) ; return null ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . workQueueMock . poll ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return queue . poll ( ) ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . zkStateReaderMock . getClusterState ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return OverseerCollectionProcessorTest . clusterStateMock ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . zkStateReaderMock . getZkClient ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return OverseerCollectionProcessorTest . solrZkClientMock ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . clusterStateMock . getCollections ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return collectionsSet ; } } ) . anyTimes ( ) ; final Set < String > liveNodes = new HashSet < String > ( ) ; for ( int i = 0 ; i < liveNodesCount ; i ++ ) { final String address = ( "localhost:" + ( 8963 + i ) ) + "_solr" ; liveNodes . add ( address ) ; <START_BUG> OverseerCollectionProcessorTest . solrZkClientMock . getBaseUrlForNodeName ( address ) ; <END_BUG> expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return address . replaceAll ( "_" , "//" ) ; } } ) . anyTimes ( ) ; } OverseerCollectionProcessorTest . solrZkClientMock . getZkClientTimeout ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return 30000 ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . clusterStateMock . hasCollection ( anyObject ( String . class ) ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Boolean > ( ) { @ Override public Boolean answer ( ) throws Throwable { String key = ( ( String ) ( getCurrentArguments ( ) [ 0 ] ) ) ; return collectionsSet . contains ( key ) ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . clusterStateMock . getLiveNodes ( ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < Object > ( ) { @ Override public Object answer ( ) throws Throwable { return liveNodes ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . solrZkClientMock . create ( anyObject ( String . class ) , anyObject ( byte [ ] . class ) , anyObject ( CreateMode . class ) , anyBoolean ( ) ) ; expectLastCall ( ) . andAnswer ( new org . easymock . IAnswer < String > ( ) { @ Override public String answer ( ) throws Throwable { String key = ( ( String ) ( getCurrentArguments ( ) [ 0 ] ) ) ; zkMap . put ( key , null ) ; handleCrateCollMessage ( ( ( byte [ ] ) ( getCurrentArguments ( ) [ 1 ] ) ) ) ; return key ; } } ) . anyTimes ( ) ; OverseerCollectionProcessorTest . solrZkClientMock . create ( anyObject ( String . class ) , anyObject ( byte [ ] . class ) , anyObject ( List . class ) , anyObject ( CreateMode . class ) , anyBoolean ( ) ) ;

Fix:
OverseerCollectionProcessorTest . zkStateReaderMock . getBaseUrlForNodeName ( address ) ;