### Question:
DelegationTokenConfig { public DelegationTokenConfig setTokenLifetime(long lifetime, TimeUnit unit) { checkArgument(lifetime >= 0, "Lifetime must be non-negative"); requireNonNull(unit, "TimeUnit was null"); this.lifetime = TimeUnit.MILLISECONDS.convert(lifetime, unit); return this; }  DelegationTokenConfig setTokenLifetime(long lifetime, TimeUnit unit); long getTokenLifetime(TimeUnit unit); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testInvalidLifetime() { new DelegationTokenConfig().setTokenLifetime(-1, TimeUnit.DAYS); }
@Test(expected = NullPointerException.class) public void testSetInvalidTimeUnit() { new DelegationTokenConfig().setTokenLifetime(5, null); }