Program: 81306
Project: 81306
Buggy source:
@Test public void shapeAndMockRecordedSoundInParallel() throws Exception {
  final AudioRecord audioRecord=Mockito.mock(AudioRecord.class);
  Mockito.when(audioRecord.getState()).thenReturn(AudioRecord.STATE_INITIALIZED);
  Mockito.when(audioRecord.getRecordingState()).thenReturn(AudioRecord.STATE_INITIALIZED);
  Mockito.when(audioRecord.read(Matchers.any(short[].class),Matchers.any(int.class),Matchers.any(int.class))).thenReturn(1024);
  PowerMockito.whenNew(AudioRecord.class).withParameterTypes(int.class,int.class,int.class,int.class,int.class).withArguments(Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class)).thenReturn(audioRecord);
  PowerMockito.mockStatic(AudioRecord.class,new Answer<Object>(){
    @Override public Object answer(    final InvocationOnMock invocation) throws Throwable {
      if ("String_Node_Str".equals(invocation.getMethod().getName())) {
        return 2048;
      }
      return invocation.callRealMethod();
    }
  }
);
  final Object stop=new Object();
  new Thread(){
    @Override public void run(){
      try {
        Thread.sleep(4000);
      }
 catch (      final InterruptedException e) {
        throw new RuntimeException(e);
      }
      boolean notified=false;
synchronized (stop) {
        while (!notified) {
          stop.notifyAll();
          notified=true;
        }
      }
    }
  }
.start();
  final List<float[]> resultFloats=FluentClient.start().whileRecordingASound(new StreamInfo(2,10000,2,44100.0f,false,true,null),stop).findLoudestFrequencies().stopWithFreqs();
  Assert.assertThat(resultFloats,new IsNot<List<float[]>>(new IsNull<List<float[]>>()));
  Assert.assertNotEquals(resultFloats.size(),0);
  Assert.assertNotEquals(resultFloats.get(0).length,0);
}

Fixed version (ground truth):
@Test public void shapeAndMockRecordedSoundInParallel() throws Exception {
  final AudioRecord audioRecord=Mockito.mock(AudioRecord.class);
  Mockito.when(audioRecord.getState()).thenReturn(AudioRecord.STATE_INITIALIZED);
  Mockito.when(audioRecord.getRecordingState()).thenReturn(AudioRecord.STATE_INITIALIZED);
  Mockito.when(audioRecord.read(Matchers.any(short[].class),Matchers.any(int.class),Matchers.any(int.class))).thenReturn(1024);
  PowerMockito.whenNew(AudioRecord.class).withParameterTypes(int.class,int.class,int.class,int.class,int.class).withArguments(Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class),Matchers.any(int.class)).thenReturn(audioRecord);
  PowerMockito.mockStatic(AudioRecord.class,new Answer<Object>(){
    @Override public Object answer(    final InvocationOnMock invocation) throws Throwable {
      if ("String_Node_Str".equals(invocation.getMethod().getName())) {
        return 2048;
      }
      return invocation.callRealMethod();
    }
  }
);
  final Object stop=new Object();
  new Thread("String_Node_Str"){
    @Override public void run(){
      try {
        Thread.sleep(4000);
      }
 catch (      final InterruptedException e) {
        throw new RuntimeException(e);
      }
      boolean notified=false;
synchronized (stop) {
        while (!notified) {
          stop.notifyAll();
          notified=true;
        }
      }
    }
  }
.start();
  final List<float[]> resultFloats=FluentClient.start().whileRecordingASound(new StreamInfo(2,10000,2,44100.0f,false,true,null),stop).findLoudestFrequencies().stopWithFreqs();
  Assert.assertThat(resultFloats,new IsNot<List<float[]>>(new IsNull<List<float[]>>()));
  Assert.assertNotEquals(resultFloats.size(),0);
  Assert.assertNotEquals(resultFloats.get(0).length,0);
}