private static String removeTerminationCharacters(final String message){
  if (message == null) {
    throw new IllegalArgumentException("Message must not be null");
  }
  String errMsg=message.trim();
  while (errMsg.endsWith(".") || errMsg.endsWith("!")) {
    errMsg=errMsg.substring(0,errMsg.length() - 1);
  }
  return errMsg;
}

private static String removeTerminationCharacters ( final String message ) { if ( message == null ) { throw new IllegalArgumentException ( "Message must not be null" ) ; } String errMsg = message . trim ( ) ; while ( errMsg . endsWith ( "." ) || errMsg . endsWith ( "!" ) ) { errMsg = errMsg . substring ( 0 , errMsg . length ( ) - 1 ) ; } return errMsg ; }
shortens the provided message by removing the trailing termination characters like ' . ' or a ' ! ' .
