title: Easy way to fill up ResultSet with data
body: <p>I want to mock a ResultSet. Seriously.
  I'm refactoring one big complicated piece of code which is parsing data from ResultSet, and I want my code to behave identically. So, I need to write a unit test for the piece being refactored to be able to test this.</p>
  
  <p>After googling I came up with 2 ideas:</p>
  
  <ol>
  <li>Use EasyMock, write looooong mocking sequence. VERY BAD solution: hard to add initial data, hard to change data, big test debugging promices.</li>
  <li>Use Apache Derby or HSQLDB to create in-memory DB, fill it from file or String array, query with some magical InMemoryDBUtils.query(sql). Then use that ResultSet. Unfortunately, I did not find any magical InMemoryDBUtils to write the test fast :-). IBM article "Isolated unit testing of persistence with Derby" seems just fine about what I need, though...</li>
  </ol>
  
  <p>Second approach looks somewhat easier and much more supportable.</p>
  
  <p>What would you advice for creating such a mock? (despite doctors, of course :-)? Am I missing <strike>an eyebrow</strike> some silver bullet? Possibly, DBUnit is the tool for this?</p>