title: How to mock a byte array by using EasyMock and PowerMock
body: <p>I tyied just like this:</p>
  
  <pre><code>byte[] mockByteArray = PowerMock.createMockAndExpectNew(byte[].class, 10);
  </code></pre>
  
  <p>But I got runtime exception: An object method could not be found! How to fix it?</p>
  
  <p>[Edit]
  I want to mock a <code>RandomAccessFile.read(byte[] buffer)</code>:</p>
  
  <pre><code>byte[] fileCutter(RandomAccessFile randomAccessFile, long position, int filePartSize) throws IOException{ 
       byte[] buffer = new byte[filePartSize];
       randomAccessFile.seek(position); 
       randomAccessFile.read(buffer);
       return buffer;
  }
  </code></pre>