### Question:
JavaResult extends FilterResult implements ResultExtractor<JavaResult> { public Object extractFromResult(JavaResult result, Export export) { Set<String> extractSet = export.getExtractSet(); if (extractSet == null) { return extractBeans(result, result.getResultMap().keySet()); } if(extractSet.size() == 1) { return result.getBean(extractSet.iterator().next()); } else { return extractBeans(result, extractSet); } } JavaResult();  JavaResult(boolean preserveOrder);  JavaResult(Map<String, Object> resultMap); Object getBean(String name); T getBean(Class<T> beanType); Map<String, Object> getResultMap(); void setResultMap(Map<String, Object> resultMap); String toString(); Object extractFromResult(JavaResult result, Export export);  }### Answer:
@Test public void extractSpecificBean() { JavaResult javaResult = new JavaResult(beans); Object result = javaResult.extractFromResult(javaResult, new Export(JavaResult.class, null, "second")); assertEquals("bean2", result); }
@Test public void extractSpecificBeans() { JavaResult javaResult = new JavaResult(beans); Map<String, Object> result = (Map<String, Object>) javaResult.extractFromResult(javaResult, new Export(JavaResult.class, null, "second,first")); Assert.assertTrue(result.containsKey("first")); Assert.assertTrue(result.containsKey("second")); Assert.assertFalse(result.containsKey("third")); }