List<SelectItem> selectItems2 = Arrays.asList(item3);
DataSet ds1 = new EmptyDataSet(selectItems1);
DataSet ds2 = new EmptyDataSet(selectItems2);
DataSet joinedDs = MetaModelHelper.getLeftJoin(ds1, ds2, new FilterItem[] { new FilterItem(item2,
OperatorType.EQUALS_TO, item3) });
assertEquals(SubSelectionDataSet.class, joinedDs.getClass());
assertEquals("[foo AS f, bar AS b, baz AS z]", Arrays.toString(joinedDs.getSelectItems()));
DataSetHeader header1 = new SimpleDataSetHeader(selectItems1);
Row row = new DefaultRow(header1, new Object[] { 1, 2 }, null);
ds1 = new InMemoryDataSet(header1, row);
joinedDs = MetaModelHelper.getLeftJoin(ds1, ds2, new FilterItem[] { new FilterItem(item2,
OperatorType.EQUALS_TO, item3) });
assertEquals("[foo AS f, bar AS b, baz AS z]", Arrays.toString(joinedDs.getSelectItems()));
assertTrue(joinedDs.next());
assertEquals("Row[values=[1, 2, null]]", joinedDs.getRow().toString());
assertFalse(joinedDs.next());