### Question:
AuthenticationBuilder { public Authentication build() { return new ImmutableAuthentication(this); } AuthenticationBuilder(Claim claim); AuthenticationBuilder setExpiration(long expiration); Authentication build();  }### Answer:
@Test public void testBuildWithoutExpiration() { Authentication a1 = new AuthenticationBuilder(validClaim).build(); assertEquals(0, a1.expiration()); assertEquals("aName", a1.domain()); assertEquals("1", a1.userId()); assertEquals("2222", a1.clientId()); assertEquals("bob", a1.user()); assertTrue(a1.roles().contains("foo")); assertTrue(a1.roles().containsAll(roles)); assertEquals(3, a1.roles().size()); }
@Test(expected = IllegalStateException.class) public void testBuildWithNullClaim() { AuthenticationBuilder a1 = new AuthenticationBuilder(null); a1.build(); }