### Question:
LanguageQueryFilter implements QueryFilter { @Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results);  }### Answer:
@Test public void filterStatementWhenStatementMatches() { String result = this.filter.filterStatement( "select doc.fullName from XWikiDocument doc ...", Query.HQL); assertEquals("select doc.fullName, doc.language from XWikiDocument doc ...", result); }
@Test public void filterStatementWhenStatementDoesntMatches() { String result = this.filter.filterStatement("select whatever", Query.HQL); assertEquals("select whatever", result); }
@Test public void filterStatementWhenStatementIsNotHQL() { String result = this.filter.filterStatement( "select doc.fullName from XWikiDocument doc ...", Query.XWQL); assertEquals("select doc.fullName from XWikiDocument doc ...", result); }