Buggy code:
public class TestHarness { protected CoreContainer container ; private SolrCore core ; private final ThreadLocal < DocumentBuilder > builderTL = new ThreadLocal < DocumentBuilder > ( ) ; private final ThreadLocal < XPath > xpathTL = new ThreadLocal < XPath > ( ) ; public UpdateRequestHandler updater ; public static SolrConfig createConfig ( String solrHome , String confFile ) { } public TestHarness ( String dataDirectory , SolrConfig solrConfig , String schemaFile ) { } public TestHarness ( String dataDirectory , SolrConfig solrConfig , IndexSchema indexSchema ) { } public TestHarness ( String coreName , CoreContainer . Initializer init ) { } private DocumentBuilder getXmlDocumentBuilder ( ) { } private XPath getXpath ( ) { } static class Initializer extends CoreContainer . Initializer { String coreName ; String dataDirectory ; SolrConfig solrConfig ; IndexSchema indexSchema ; public Initializer ( String coreName , String dataDirectory , SolrConfig solrConfig , IndexSchema indexSchema ) { } public String getCoreName ( ) { } @ Override public CoreContainer initialize ( ) { } } public CoreContainer getCoreContainer ( ) { } public SolrCore getCore ( ) { } public String update ( String xml ) { } public String validateUpdate ( String xml ) throws SAXException { } public String validateErrorUpdate ( String xml ) throws SAXException { } public String checkUpdateStatus ( String xml , String code ) throws SAXException { } public String validateQuery ( SolrQueryRequest req , String ... tests ) throws Exception { } public String query ( SolrQueryRequest req ) throws Exception { } public String query ( String handler , SolrQueryRequest req ) throws Exception { } public SolrQueryResponse queryAndResponse ( String handler , SolrQueryRequest req ) throws Exception { } public String validateXPath ( String xml , String ... tests ) throws XPathExpressionException , SAXException { } public void close ( ) { if ( ( container ) != null ) { for ( SolrCore c : container . getCores ( ) ) { if ( ( c . getOpenCount ( ) ) > 1 ) <START_BUG> throw new RuntimeException ( ( "SolrCore.getOpenCount()==" + ( core . getOpenCount ( ) ) ) ) ; <END_BUG> } } if ( ( container ) != null ) { container . shutdown ( ) ; container = null ; } } public static StringBuffer makeSimpleDoc ( String ... fieldsAndValues ) { } public static String deleteByQuery ( String q , String ... args ) { } public static String deleteById ( String id , String ... args ) { } private static String delete ( String val , String ... args ) { } public static String optimize ( String ... args ) { } private static String simpleTag ( String tag , String ... args ) { } public static String commit ( String ... args ) { } public TestHarness . LocalRequestFactory getRequestFactory ( String qtype , int start , int limit ) { } public TestHarness . LocalRequestFactory getRequestFactory ( String qtype , int start , int limit , String ... args ) { } public TestHarness . LocalRequestFactory getRequestFactory ( String qtype , int start , int limit , Map < String , String > args ) { } public class LocalRequestFactory { public String qtype = null ; public int start = 0 ; public int limit = 1000 ; public Map < String , String > args = new HashMap < String , String > ( ) ; public LocalRequestFactory ( ) { } public LocalSolrQueryRequest makeRequest ( String ... q ) { } } }

Fix:
throw new RuntimeException ( ( "SolrCore.getOpenCount()==" + ( c . getOpenCount ( ) ) ) ) ;