### Question:
DefaultJdbcTable implements JdbcTable { @Nonnull public static <T extends JdbcTable> JdbcFunction<ResultSet, T> fromResultSet(@Nullable final DatabaseMetaData databaseMetaData) { return new JdbcFunction<ResultSet, T>() { @Override @SuppressWarnings("unchecked") public T apply(final ResultSet resultSet) throws SQLException { return (T) fromResultSet(resultSet, databaseMetaData); } }; } DefaultJdbcTable(@Nonnull final String name, @Nonnull final String type); @Nonnull static JdbcFunction<ResultSet, T> fromResultSet(@Nullable final DatabaseMetaData databaseMetaData); static DefaultJdbcTable fromResultSet(@Nonnull final ResultSet resultSet, @Nullable final DatabaseMetaData databaseMetaData); @Nullable @Override String getCatalog(); void setCatalog(@Nullable final String catalog); void setCatalogSeparator(@Nullable final String catalogSeparator); void setIdentifierQuoteString(@Nullable final String identifierQuoteString); DefaultJdbcTable setMetaData(@Nonnull final DatabaseMetaData metaData); @Nonnull @Override String getName(); @Nonnull @Override String getQualifiedIdentifier(); @Nullable @Override String getRemarks(); void setRemarks(@Nullable final String remarks); @Nullable @Override String getSchema(); void setSchema(@Nullable final String schema); @Nonnull @Override String getType();  }### Answer:
@Test public void fromResultSet() throws Exception { final ResultSet rs = Mockito.mock(ResultSet.class); Mockito.when(rs.getString(JdbcConstants.TABLE_CAT)).thenReturn("finance"); Mockito.when(rs.getString(JdbcConstants.TABLE_SCHEM)).thenReturn("dbo"); Mockito.when(rs.getString(JdbcConstants.TABLE_NAME)).thenReturn("people"); Mockito.when(rs.getString(JdbcConstants.TABLE_TYPE)).thenReturn("TABLE"); Mockito.when(rs.getString(JdbcConstants.REMARKS)).thenReturn("Finance People"); final DefaultJdbcTable table = DefaultJdbcTable.fromResultSet(rs, Mockito.mock(DatabaseMetaData.class)); Assert.assertEquals("finance", table.getCatalog()); Assert.assertEquals("dbo", table.getSchema()); Assert.assertEquals("people", table.getName()); Assert.assertEquals("finance.dbo.people", table.getQualifiedIdentifier()); Assert.assertEquals("TABLE", table.getType()); Assert.assertEquals("Finance People", table.getRemarks()); final DatabaseMetaData metaData = Mockito.mock(DatabaseMetaData.class); Mockito.when(metaData.getCatalogSeparator()).thenReturn("."); Mockito.when(metaData.getIdentifierQuoteString()).thenReturn("\""); table.setMetaData(metaData); Assert.assertEquals("\"finance\".\"dbo\".\"people\"", table.getQualifiedIdentifier()); }