JsonConverter extends AbstractConfigurationConverter { public static String plexusPluralStem(final String key) { String[] camelWords = KEY_DELIM.split(key); String lastWord = camelWords[camelWords.length - 1].toLowerCase(); lastWord = DOUBLE_ESS_E_ESS_TO_DOUBLE_ESS.matcher(lastWord).replaceAll("ss"); lastWord = I_E_ESS_TO_I.matcher(lastWord).replaceAll("i"); lastWord = I_E_ESS_TO_IE.matcher(lastWord).replaceAll("ie"); lastWord = PRECEDING_VOWEL_NOT_DOUBLE_ESS.matcher(lastWord).matches() ? ESS_SUFFIX_TO_DROP.matcher(lastWord).replaceAll("") : lastWord; lastWord = REPLACEABLE_WHY_TO_I.matcher(lastWord).replaceAll("i"); return lastWord; }  static String plexusPluralStem(final String key); @Override boolean canConvert(final Class<?> type); @Override Object fromConfiguration(final ConverterLookup lookup,
                                    final PlexusConfiguration configuration,
                                    final Class<?> type,
                                    final Class<?> enclosingType,
                                    final ClassLoader loader,
                                    final ExpressionEvaluator evaluator,
                                    final ConfigurationListener listener); JsonValue convertChild(final @NotNull PlexusConfiguration child, final ExpressionEvaluator evaluator); static Object stringToValue(String string);  }
@Test public void testPlexusPluralStem() { Map<String, String> cases = new LinkedHashMap<>(); cases.put("meetings", "meeting"); cases.put("caresses", "caress"); cases.put("flatFiles", "file"); cases.put("pinkUnicornPonies", "poni"); cases.put("pony", "poni"); cases.put("some_people_like_snakes", "snake"); cases.put("snake", "snake"); cases.put("some.people.like.dots", "dot"); cases.put("denyNodeTypes", "type"); cases.put("denyNodeType", "type"); cases.put("abyss", "abyss"); cases.put("why", "whi"); cases.put("whys", "whi"); for (Map.Entry<String, String> entry : cases.entrySet()) { Assert.assertEquals("should stem to", entry.getValue(), JsonConverter.plexusPluralStem(entry.getKey())); } }