### Question:
JobArrayHttpMessageConverter implements HttpMessageConverter<Job[]> { @Override public Job[] read(Class<? extends Job[]> clazz, HttpInputMessage inputMessage) throws IOException { XmlResponse xml = new XmlResponse(inputMessage.getBody()); Integer count = xml.evaluateAsInteger("count(/hudson/job)"); Job[] jobs = new Job[count]; for (int i = 0; i < count; i++) { String prefix = "/hudson/job[" + (i + 1) + "]"; jobs[i] = new Job() .setName(xml.evaluateAsString(prefix + "/name")) .setDisplayName(xml.evaluateAsString(prefix + "/displayName")) .setUrl(xml.evaluateAsString(prefix + "/url")) .setBuildable(xml.evaluateAsBoolean(prefix + "/buildable")) .setInQueue(xml.evaluateAsBoolean(prefix + "/inQueue")) .setNextBuildNumber(xml.evaluateAsLong(prefix + "/nextBuildNumber")); } return jobs; }  @Override boolean canRead(Class<?> clazz); @Override boolean canWrite(Class<?> clazz); @Override Job[] read(Class<? extends Job[]> clazz, HttpInputMessage inputMessage); @Override void write(Job[] t, String contentType, HttpOutputMessage outputMessage);  }### Answer:
@Test public void read() throws Exception { HttpInputMessage inputMessage = new MockHttpInputMessage("" + "<hudson>" + "<mode>NORMAL</mode>" + "<nodeDescription>Node description</nodeDescription>" + "<nodeName/>" + "<numExecutors>2</numExecutors>" + "<useSecurity>false</useSecurity>" + "<job>" + "<name>vacuum.my.room</name>" + "<displayName>Vacuum my room</displayName>" + "<url>http: + "<buildable>true</buildable>" + "<inQueue>false</inQueue>" + "<nextBuildNumber>69</nextBuildNumber>" + "</job>" + "<job>" + "<name>do.shopping</name>" + "<displayName>Do shopping</displayName>" + "<url>http: + "<buildable>false</buildable>" + "<inQueue>true</inQueue>" + "<nextBuildNumber>13</nextBuildNumber>" + "</job>" + "</hudson>" ); Job[] jobs = converter.read(Job[].class, inputMessage); assertEquals("vacuum.my.room", jobs[0].getName()); assertEquals("Vacuum my room", jobs[0].getDisplayName()); assertEquals("http: assertTrue(jobs[0].getBuildable()); assertFalse(jobs[0].getInQueue()); assertEquals(new Long(69), jobs[0].getNextBuildNumber()); assertEquals("do.shopping", jobs[1].getName()); assertEquals("Do shopping", jobs[1].getDisplayName()); assertEquals("http: assertFalse(jobs[1].getBuildable()); assertTrue(jobs[1].getInQueue()); assertEquals(new Long(13), jobs[1].getNextBuildNumber()); }