### Question:
TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentException("start must be lesser than end."); } mPattern.setLength(0); mPattern.append(String.valueOf(start)) .append("-") .append(String.valueOf(end)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end); @Override String toString(); void setValue(int value); void setIncrement(int interval, int from); void setRawValue(String rawValue); String parse(String rawValue);  }### Answer:
@Test public void should_throw_if_lower_bound_higher_than_upper_one() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("start must be lesser than end."); mTimePattern.setRange(10, 0); }
@Test public void should_throw_if_start_less_than_lower_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("start cannot be less than lower bound."); mTimePattern.setRange(-10, 0); }
@Test public void should_throw_if_upper_bound_negative() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("end cannot be more than upper bound."); mTimePattern.setRange(0, 200); }