JsonConverter extends AbstractConfigurationConverter { JsonObject readJsonObjectFromConfig(final @NotNull PlexusConfiguration config, final ExpressionEvaluator evaluator) throws ComponentConfigurationException { final JsonObjectBuilder retValue = Json.createObjectBuilder(); for (PlexusConfiguration child : config.getChildren()) { final String key = child.getName(); retValue.add(key, convertChild(child, evaluator)); } return retValue.build(); }  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 testReadJsonObjectFromConfig() throws Exception { ExpressionEvaluator eval = mock(ExpressionEvaluator.class); when(eval.evaluate(anyString())).thenAnswer(call -> call.getArgument(0, String.class)); assertEquals("expect empty json object for empty value", JsonValue.EMPTY_JSON_OBJECT, converter().readJsonObjectFromConfig(xml("emptyFoo.xml"), eval)); assertEquals("expect json object for value", key("foo", "one").get(), converter().readJsonObjectFromConfig(xml("foosFoo.xml"), eval)); assertEquals("expect json object for value", key("bar", "one").get(), converter().readJsonObjectFromConfig(xml("foosBar.xml"), eval)); }