public boolean isValid() {
    if (mIntervals.isEmpty()) {
      return false;
    }
    if (mIntervals.size() == 1 && mIntervals.get(0).equals(Interval.NEVER)) {
      return false;
    }
    return true;
  }
@Test
  public void isValid() {
    Assert.assertTrue(IntervalSet.ALWAYS.isValid());
    Assert.assertFalse(IntervalSet.NEVER.isValid());

    Assert.assertTrue(new IntervalSet(Interval.between(1, 2)).isValid());
    Assert.assertTrue(new IntervalSet(Interval.before(10)).isValid());
    Assert.assertTrue(new IntervalSet(Interval.after(10)).isValid());

    Assert.assertFalse(new IntervalSet(Interval.between(2, 1)).isValid());
    Assert.assertFalse(new IntervalSet(Collections.emptyList()).isValid());
  }