TableFQName { public static TableFQName forCatalogAndName(String catalog, String tableName) { return new TableFQName(catalog, null, tableName); } TableFQName(String catalog, String schema, String table); static TableFQName forName(String tableName); static TableFQName forSchemaAndName(String schema, String tableName); static TableFQName forCatalogAndName(String catalog, String tableName); static TableFQName forCatalogSchemaAndName(String catalog, String schema, String tableName); boolean hasCatalog(); boolean hasSchema(); String getCatalog(); String getSchema(); String getTable(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals_CatalogName() { TableFQName n1 = TableFQName.forCatalogAndName("c1", "t1"); TableFQName n2 = TableFQName.forCatalogAndName("c1", "t1"); TableFQName n3 = TableFQName.forCatalogAndName("c2", "t1"); TableFQName n4 = TableFQName.forCatalogAndName("c1", "t2"); assertEquals(n1, n1); assertEquals(n1, n2); assertNotEquals(n1, n3); assertNotEquals(n1, n4); }