Answer getRegisteredTableAnswer() {
    return (InvocationOnMock x) -> {
      TableDescriptor descriptor = x.getArgumentAt(0, TableDescriptor.class);
      String tableId = "t1";
      TableImpl mockTable = mock(TableImpl.class);
      when(mockTable.getTableId()).thenReturn(tableId);
      this.registeredTables.putIfAbsent(descriptor.getTableId(), mockTable);
      return this.registeredTables.get(descriptor.getTableId());
    };
  }
Base class for all unit tests for translators
samza-sql/src/test/java/org/apache/samza/sql/translator/TranslatorTestBase.java