TransformerFactoryBuilder extends AbstractFactoryBuilder<TransformerFactory> { public TransformerFactory build() { TransformerFactory transformerFactory = TransformerFactory.newInstance(); setSecurityFeatures(transformerFactory); setSecurityAttributes(transformerFactory); return transformerFactory; } private  TransformerFactoryBuilder(); static TransformerFactoryBuilder getSecureTransformerBuilder(); TransformerFactory build(); @Override TransformerFactoryBuilder enableFeature(String feature); @Override TransformerFactoryBuilder disableFeature(String feature); @Override TransformerFactoryBuilder setAttribute(String attribute, Object value); @Override TransformerFactoryBuilder removeAttribute(String attribute);  }
@Test public void buildTest() { TransformerFactoryBuilder secureTransformerBuilder = TransformerFactoryBuilder.getSecureTransformerBuilder(); TransformerFactory transformerFactory = secureTransformerBuilder.build(); assertNotNull(transformerFactory); }