### Question:
IndexNotFoundException extends NamingException { public String getIndexName() { return indexName; } IndexNotFoundException( String indexName );  IndexNotFoundException( String message, String indexName );  IndexNotFoundException( String message, String indexName, Throwable rootCause ); String getIndexName();  }### Answer:
@Test public void testConstructor1() { IndexNotFoundException exception = new IndexNotFoundException( null ); assertNull( exception.getIndexName() ); exception = new IndexNotFoundException( "cn" ); assertEquals( "cn", exception.getIndexName() ); }
@Test public void testConstructor2() { IndexNotFoundException exception = new IndexNotFoundException( null, null ); assertNull( exception.getMessage() ); assertNull( exception.getIndexName() ); exception = new IndexNotFoundException( "message", "cn" ); assertEquals( "message", exception.getMessage() ); assertEquals( "cn", exception.getIndexName() ); }
@Test public void testConstructor3() { IndexNotFoundException exception = new IndexNotFoundException( null, null, null ); assertNull( exception.getMessage() ); assertNull( exception.getIndexName() ); assertNull( exception.getCause() ); exception = new IndexNotFoundException( "message", "cn", new Exception() ); assertEquals( "message", exception.getMessage() ); assertEquals( "cn", exception.getIndexName() ); assertNotNull( exception.getCause() ); }