### Question:
TextRuleList extends AbstractRulesList { public static Filter classLanguageFilter(String lang) { if (lang == null) lang = XMapPane.ENV_LANG_DEFAULT; Expression exEnv = ff.function("env", ff.literal(XMapPane.ENV_LANG), ff.literal(XMapPane.ENV_LANG_DEFAULT)); Filter filter = ff.equals(ff.literal(lang), exEnv); return filter; } TextRuleList(StyledFeaturesInterface<?> styledFeatures,
			boolean withDefaults);  TextRuleList(StyledFeaturesInterface<?> styledFeatures,
			GeometryForm geometryForm, boolean withDefaults); static Filter classLanguageFilter(String lang); int addClass(TextSymbolizer ts, String ruleName, Filter filter,
			boolean enabled, String lang, Double minScale, Double maxScale); int addDefaultClass(); int addDefaultClass(String lang); int countClasses(); boolean existsClass(Filter filter, String lang); Filter getClassFilter(int index); String getClassLang(int index); TextSymbolizer getClassSymbolizer(int index); ArrayList<String> getDefaultLanguages(); @Deprecated String getRuleName(); String getRuleName(int index); List<String> getRuleNames(); @Override List<Rule> getRules(); @Deprecated int getSelIdx(); StyledFeaturesInterface<?> getStyledFeatures(); @Deprecated TextSymbolizer getSymbolizer(); List<TextSymbolizer> getSymbolizers(); boolean hasDefault(); void importClassesFromStyle(RulesListInterface symbRL,
			Component owner); @Override void importRules(List<Rule> rules); Boolean isClassEnabled(int index); @Override void parseMetaInfoString(String metaInfoString, FeatureTypeStyle fts); void removeClass(int idx); void removeClassEnabled(int classIdx); void removeClassMaxScale(int classIdx); void removeClassMinScale(int classIdx); void setClassEnabled(int index, boolean b); void setClassFilter(int index, Filter filter); void setClassMaxScale(int index, Double maxValue); void setClassMinMaxScales(int index, Double minValue, Double maxValue); void setClassMinScale(int index, Double minValue); void setRuleNames(List<String> ruleNames); @Deprecated void setSelIdx(int selIdx); void setSymbolizers(List<TextSymbolizer> symbolizers); static final String DEFAULT_CLASS_RULENAME; static final Filter DEFAULT_FILTER_ALL_OTHERS; static final PropertyIsEqualTo oldClassesDisabledFilter; static final PropertyIsEqualTo oldClassesEnabledFilter; }### Answer:
@Test public void testLanguageFilterEnvFunction() throws IOException { Filter filter = TextRuleList.classLanguageFilter("de"); System.out.println(filter); assertEquals("[ de = env([LANG], [XX]) ]", filter.toString()); FeatureCollection<SimpleFeatureType, SimpleFeature> testFeatures = TestDatasetsVector.arabicInHeader .getFeatureCollection(); Iterator<SimpleFeature> it = testFeatures.iterator(); try { SimpleFeature f = it.next(); EnvFunction.setLocalValue("LANG", "de"); assertTrue(filter.evaluate(f)); EnvFunction.setLocalValue("LANG", "en"); assertFalse(filter.evaluate(f)); } finally { testFeatures.close(it); } }