source: class ElasticsearchIndexTest {
  
    private final DSL dsl;
    @Mock
    private ElasticsearchClient client;
    @Mock
    private ElasticsearchExprValueFactory exprValueFactory;
    @Mock
    private Settings settings;
  
    @Test
    void shouldDiscardPhysicalFilterIfConditionPushedDown() {
  
target:     when(settings.getSettingValue(Settings.Key.QUERY_SIZE_LIMIT)).thenReturn(200);
  
      ReferenceExpression field = ref("name", STRING);
      NamedExpression named = named("n", field);
      Expression filterExpr = dsl.equal(field, literal("John"));
  
      String indexName = "test";
      ElasticsearchIndex index = new ElasticsearchIndex(client, settings, indexName);
      PhysicalPlan plan = index.implement(
          project(
              filter(
                  relation(indexName),
                  filterExpr
              ),
              named));
  
      assertTrue(plan instanceof ProjectOperator);
      assertTrue(((ProjectOperator) plan).getInput() instanceof ElasticsearchIndexScan);
    }
  
  }