### Question:
PluginArrayHttpMessageConverter implements HttpMessageConverter<Plugin[]> { @Override public Plugin[] read(Class<? extends Plugin[]> clazz, HttpInputMessage inputMessage) throws IOException { XmlResponse xml = new XmlResponse(inputMessage.getBody()); final Integer count = xml.evaluateAsInteger("count( Plugin[] plugins = new Plugin[count]; for (int i = 0; i < count; i++) { final String prefix = "/*/plugin[" + (i + 1) + "]"; plugins[i] = new Plugin() .setActive(xml.evaluateAsBoolean(prefix + "/active")) .setBundled(xml.evaluateAsBoolean(prefix + "/bundled")) .setDeleted(xml.evaluateAsBoolean(prefix + "/deleted")) .setDowngradable(xml.evaluateAsBoolean(prefix + "/downgradable")) .setEnabled(xml.evaluateAsBoolean(prefix + "/enabled")) .setHasUpdate(xml.evaluateAsBoolean(prefix + "/hasUpdate")) .setPinned(xml.evaluateAsBoolean(prefix + "/pinned")) .setShortName(xml.evaluateAsString(prefix + "/shortName")) .setLongName(xml.evaluateAsString(prefix + "/longName")) .setUrl(xml.evaluateAsString(prefix +"/url")) .setVersion(xml.evaluateAsString(prefix + "/version")); } return plugins; }  @Override boolean canRead(Class<?> clazz); @Override boolean canWrite(Class<?> clazz); @Override Plugin[] read(Class<? extends Plugin[]> clazz, HttpInputMessage inputMessage); @Override void write(Plugin[] t, String contentType, HttpOutputMessage outputMessage);  }### Answer:
@Test public void read() throws Exception { HttpInputMessage inputMessage = new MockHttpInputMessage("" + "<localPluginManager>" + "<plugin>" + "<active>true</active>" + "<bundled>true</bundled>" + "<deleted>false</deleted>" + "<downgradable>false</downgradable>" + "<enabled>true</enabled>" + "<hasUpdate>false</hasUpdate>" + "<longName>Jenkins Mailer Plugin</longName>" + "<pinned>false</pinned>" + "<shortName>mailer</shortName>" + "<url>http: + "<version>1.5</version>" + "</plugin>" + "<plugin>" + "<active>true</active>" + "<bundled>true</bundled>" + "<deleted>false</deleted>" + "<downgradable>false</downgradable>" + "<enabled>true</enabled>" + "<hasUpdate>false</hasUpdate>" + "<longName>External Monitor Job Type Plugin</longName>" + "<pinned>false</pinned>" + "<shortName>external-monitor-job</shortName>" + "<url>http: + "<version>1.1</version>" + "</plugin>" + "</localPluginManager>"); Plugin[] plugins = converter.read(Plugin[].class, inputMessage); assertEquals(2, plugins.length); assertTrue(plugins[0].getActive()); assertTrue(plugins[0].getBundled()); assertFalse(plugins[0].getDeleted()); assertFalse(plugins[0].getDowngradable()); assertTrue(plugins[0].getEnabled()); assertFalse(plugins[0].getHasUpdate()); assertEquals("Jenkins Mailer Plugin", plugins[0].getLongName()); assertFalse(plugins[0].getPinned()); assertEquals("mailer", plugins[0].getShortName()); assertEquals("http: assertEquals("1.5", plugins[0].getVersion()); }