### Question:
ResultSetIterator implements RelationalInput { @Override public String relationName() { return relationName; } ResultSetIterator(ResultSet resultSet);  ResultSetIterator(ResultSet resultSet, String relationName); @Override boolean hasNext(); @Override List<String> next(); @Override int numberOfColumns(); @Override String relationName(); @Override ImmutableList<String> columnNames(); @Override void close(); static final String UNKNOWN_RELATION_NAME; }### Answer:
@Test public void testRelationName() throws SQLException { ResultSetIterator resultSetIterator = new ResultSetIterator(twoLinesResultSetFixture.getTestData()); assertEquals(twoLinesResultSetFixture.getExpectedRelationName(), resultSetIterator.relationName()); }
@Test public void testMissingRelationNameWithFallback() throws SQLException { ResultSetIterator resultSetIterator = new ResultSetIterator( emptyResultSetWithoutRelationNameFixture.getTestData(), emptyResultSetWithoutRelationNameFixture.getExpectedRelationName() ); assertEquals(emptyResultSetWithoutRelationNameFixture.getExpectedRelationName(), resultSetIterator.relationName()); }
@Test public void testMissingRelationNameWithoutFallback() throws SQLException { ResultSetIterator resultSetIterator = new ResultSetIterator(emptyResultSetWithoutRelationNameFixture.getTestData()); assertEquals(ResultSetIterator.UNKNOWN_RELATION_NAME, resultSetIterator.relationName()); }