So, I am working on a project, and I have to test if my method catches a `ParseException` when it occures. Here is how the method that I need to test looks like:

```
public void convertToModel(final BuildStone bs, final TextBuildStone model) {
    try {
        model.setBeginDateRange(ProjectDateConverter.projectDateToCalendarDefaultMin(bs.getFromDate(), true));
    } catch (final ParseException e) {
        SystemContext.getLogger().warning(
                this,
                "treatGeneralData",
                "Date not converted: {0}, BeginDate set at MinDate",
                bs.getFromDate());
        model.setBeginDateRange(CalendarConstants.getMinDate());
    }

```

So I have to test when this method catches a `ParseException`.

The method that throws a ParseException is `projectDateToCalendarDefaultMin` , here is the code of that method:

```
public static Calendar projectDateToCalendarDefaultMin(final BigDecimal dateValue, final boolean useMinDate) throws ParseException {
    return dateValue == null ? ProjectDateConverter.projectDateStringToCalendar(null, useMinDate, false) : ProjectDateConverter
            .projectDateStringToCalendar(dateValue.toString(), useMinDate, false);

```

The method that throws ParseException is called `projectDateStringToCalendar`. Here is how that one looks like:

```
private static Calendar projectDateStringToCalendar(final String dateValue, final boolean useMinDate, final boolean useMaxDate)
        throws ParseException {
    if (useMinDate && useMaxDate) {
        throw new IllegalArgumentException("useMinDate and useMaxDate may not be set as true ");
    }
    if (StringUtils.isEmpty(dateValue)) {
        if (useMinDate) {
            return CalendarConstants.getMinDate();
        } else if (useMaxDate) {
            return CalendarConstants.getMaxDate();
        } else {
            return null;
        }
    }
...
final GregorianCalendar gc = new GregorianCalendar();
    gc.setTime(new SimpleDateFormat("yyyyMMdd").parse(dateValue));

    return gc;
}

```

So this is where the `ParseException` is finally thrown, at the `parse()` method. `ParseException` is from `text.parse` package and the method parse looks like this:

```
 public Date parse(String source) throws ParseException
{
    ParsePosition pos = new ParsePosition(0);
    Date result = parse(source, pos);
    if (pos.index == 0)
        throw new ParseException("Unparseable date: \"" + source + "\"" ,
            pos.errorIndex);
    return result;
}

```

What I have already tried to do is to set `bs.getFromDate` to null but the test would always be red. I used `@Test(expected: ParseException.class)` annotation in my test, but I just can't make it go green. Perhaps `bs.getFromDate` is not the right value that is being parsed? 

Does anyone have any other idea how to make this test work? Thanks in advance!