I found a solution after browsing the Fitnesse forums, straight from one of the developers for Fit, Rick Mugridge:
public String findString(String s) {
if ("".equals(s))
return null;
return s;
}
}
I included this in the ArrayFixture and it worked! Here are some interesting points from Rick's message:
When the myList() method is called for the second table, FitLibrary automatically wraps it with a SetFixture (because the returned value is a Set). When it checks each of the name elements, which are of type String, it determines that there is a findString() method of the right types, so it calls it to parse the value from the cells in the name column. That method turns an empty string into a null so that it will match correctly with the actual value of null.
For any type T, FitLibrary checks for a method public Object findT(String s). It calls it to parse the String value from a table cell. This can be used in several ways.
SetFixture, ArrayFixture, etc will access private instance variables if necessary (eg, no getter)
Arrays, Lists, Maps, Sets and other Objects are all auto-wrapped with an appropriate fixture in flow
Flow occurs when the first fixture in a DoFixture (In the next release, a DoFixture doesn't need to be the first fixture for flow to occur; it just starts later.)