InvalidParameterException extends RuntimeException { public InvalidParameterException() { } InvalidParameterException();  InvalidParameterException( String msg );   }
@Test public void testInvalidParameterException() { try { Constructor<InvalidParameterException> constructor = InvalidParameterException.class.getDeclaredConstructor(); constructor.setAccessible( true ); constructor.newInstance(); } catch ( Exception e ) { fail( InvalidParameterException.class.getSimpleName() + " Does not have a no args constructor" ); } try { Constructor<InvalidParameterException> constructor = InvalidParameterException.class.getDeclaredConstructor( String.class ); constructor.setAccessible( true ); constructor.newInstance( "testMsg" ); } catch ( Exception e ) { fail( ContentException.class.getSimpleName() + " Does not have a constructor with String parameter" ); } }