@VisibleForTesting
  public static String parseErrorMessage( String errorMessage, Date now ) {
    StringBuilder parsed = new StringBuilder();
    try {
      String[] splitString = errorMessage.split( "\\n" );
      parsed.append( splitString[1] ).append( "\n" );
      for ( int i = 2; i < splitString.length; i++ ) {
        String dateStr = splitString[i].substring( 0, splitString[i].indexOf( " -" ) );
        if ( isDateAfterOrSame( formatDate( now ), dateStr ) ) {
          parsed.append( splitString[i] ).append( "\n" );
        }
      }
    } catch ( Exception e ) {
      return errorMessage;
    }
    return parsed.toString();
  }
@Test
  public void parseErrorMessageUsingBeforeDateTest() {
    String result = TransPreviewProgressDialog.parseErrorMessage( ERROR_MSG, parseDate( BEFORE_DATE_STR ) );
    assertEquals( FAILED_TO_INIT_MSG + EXPECTED_ERROR_MSG, result );
  }