@Test public void testGetSpecificProductHeader() { final Product product = new Product("nasen", "mann", 2, 2); final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variable_header = new MetadataElement("Variable_Header"); final MetadataElement sph = new MetadataElement("Specific_Product_Header"); variable_header.addElement(sph); metadataRoot.addElement(variable_header); final MetadataElement specificProductHeader = ExporterUtils.getSpecificProductHeader(product); assertSame(sph, specificProductHeader); }
static MetadataElement getSpecificProductHeader(Product product) { final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variableHeader = metadataRoot.getElement("Variable_Header"); if (variableHeader == null) { return null; } final MetadataElement specificProductHeader = variableHeader.getElement("Specific_Product_Header"); if (specificProductHeader == null) { return null; } return specificProductHeader; }
ExporterUtils { static MetadataElement getSpecificProductHeader(Product product) { final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variableHeader = metadataRoot.getElement("Variable_Header"); if (variableHeader == null) { return null; } final MetadataElement specificProductHeader = variableHeader.getElement("Specific_Product_Header"); if (specificProductHeader == null) { return null; } return specificProductHeader; } }
ExporterUtils { static MetadataElement getSpecificProductHeader(Product product) { final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variableHeader = metadataRoot.getElement("Variable_Header"); if (variableHeader == null) { return null; } final MetadataElement specificProductHeader = variableHeader.getElement("Specific_Product_Header"); if (specificProductHeader == null) { return null; } return specificProductHeader; }  }
ExporterUtils { static MetadataElement getSpecificProductHeader(Product product) { final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variableHeader = metadataRoot.getElement("Variable_Header"); if (variableHeader == null) { return null; } final MetadataElement specificProductHeader = variableHeader.getElement("Specific_Product_Header"); if (specificProductHeader == null) { return null; } return specificProductHeader; }   }
ExporterUtils { static MetadataElement getSpecificProductHeader(Product product) { final MetadataElement metadataRoot = product.getMetadataRoot(); final MetadataElement variableHeader = metadataRoot.getElement("Variable_Header"); if (variableHeader == null) { return null; } final MetadataElement specificProductHeader = variableHeader.getElement("Specific_Product_Header"); if (specificProductHeader == null) { return null; } return specificProductHeader; }    }