EnvironmentTagExtractor implements TagExtractor { public static Map<String, String> filterEnvironmentTags(final Map<String, String> env) { final Map<String, String> tags = new HashMap<>(); for (final Map.Entry<String, String> e : env.entrySet()) { if (e.getKey().startsWith(FFWD_TAG_PREFIX)) { final String tag = e.getKey().substring(FFWD_TAG_PREFIX.length()); tags.put(tag.toLowerCase(), e.getValue()); } } return tags; } EnvironmentTagExtractor();  EnvironmentTagExtractor(Supplier<Map<String, String>> enviromentSupplier); @Override Map<String, String> addTags(Map<String, String> tags); static Map<String, String> filterEnvironmentTags(final Map<String, String> env); static final String FFWD_TAG_PREFIX; static Map<String, String> environmentTags; }
@Test public void testFilterEnvironment() { final Map<String, String> out = EnvironmentTagExtractor.filterEnvironmentTags(tags); assertEquals(ImmutableMap.of("foo", "bar", "bar", "baz"), out); }