Program: 81287
Project: 81287
Buggy source:
@Test public void mockRecordedAndProcessedSound() 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.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();
  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);
  final List<Sound> list=FluentClient.start().inParallelWhileRecordingASound(new StreamInfo(2,10000,2,44100.0f,false,true,null),stop,FluentClientOperation.prepare().importToSound().apply(new EightBitsSoundTransform(25)).build(),Sound.class);
  try {
    Thread.sleep(4000);
  }
 catch (  final InterruptedException e) {
    throw new RuntimeException(e);
  }
  boolean notified=false;
synchronized (stop) {
    while (!notified) {
      stop.notify();
      notified=true;
    }
  }
  try {
    Thread.sleep(4000);
  }
 catch (  final InterruptedException e) {
    throw new RuntimeException(e);
  }
  Assert.assertThat(list,new IsNot<List<Sound>>(new IsNull<List<Sound>>()));
  Assert.assertNotEquals(list.size(),0);
}

Fixed version (ground truth):
@Test public void mockRecordedAndProcessedSound() 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.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();
  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);
  final List<Sound> list=FluentClient.start().inParallelWhileRecordingASound(new StreamInfo(2,10000,2,44100.0f,false,true,null),stop,FluentClientOperation.prepare().importToSound().apply(new EightBitsSoundTransform(25)).build(),Sound.class);
  try {
    Thread.sleep(4000);
  }
 catch (  final InterruptedException e) {
    throw new RuntimeException(e);
  }
  boolean notified=false;
synchronized (stop) {
    while (!notified) {
      stop.notifyAll();
      notified=true;
    }
  }
  try {
    Thread.sleep(4000);
  }
 catch (  final InterruptedException e) {
    throw new RuntimeException(e);
  }
  Assert.assertThat(list,new IsNot<List<Sound>>(new IsNull<List<Sound>>()));
  Assert.assertNotEquals(list.size(),0);
}