### Question:
ReplicaHiveEndpoint extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(TableReplication tableReplication) { return super.getTableAndStatistics(tableReplication.getReplicaDatabaseName(), tableReplication.getReplicaTableName()); } ReplicaHiveEndpoint(
      String name,
      HiveConf hiveConf,
      Supplier<CloseableMetaStoreClient> metaStoreClientSupplier); @Override TableAndStatistics getTableAndStatistics(TableReplication tableReplication);  }### Answer:
@Test public void useCorrectReplicaTableName() throws Exception { ReplicaHiveEndpoint replicaDiffEndpoint = new ReplicaHiveEndpoint("name", hiveConf, metastoreSupplier); when(metastoreSupplier.get()).thenReturn(metastoreClient); when(metastoreClient.getTable("dbname", "tableName")).thenReturn(table); when(table.getSd()).thenReturn(sd); when(tableReplication.getReplicaDatabaseName()).thenReturn("dbname"); when(tableReplication.getReplicaTableName()).thenReturn("tableName"); TableAndStatistics tableAndStats = replicaDiffEndpoint.getTableAndStatistics(tableReplication); assertThat(tableAndStats.getTable(), is(table)); }