FundingTreeParser implements Serializable { public String extractFundingClass(List<String> fundingTreeList) throws IOException { if (CollectionUtils.isNotEmpty(fundingTreeList)) { for (String fundingTreeXML : fundingTreeList) { if (StringUtils.isNotBlank(fundingTreeXML)) { String result = extractFundingClass(fundingTreeXML); if (result!=null) { return result; } } } } return null; } FundingTreeParser(); String extractFundingClass(List<String> fundingTreeList); String extractFundingClass(String fundingTreeXML);  }
@Test public void testFundingClassExtraction() throws Exception { List<String> fundingTreeList = Collections.singletonList(readFundingTree()); String fundingClass = parser.extractFundingClass(fundingTreeList); assertNotNull(fundingClass); assertEquals(FUNDING_CLASS, fundingClass); }
@Test public void testFundingClassExtractionEmptyInput() throws Exception { List<String> fundingTreeList = Collections.emptyList(); String fundingClass = parser.extractFundingClass(fundingTreeList); assertNull(fundingClass); }