@Test
public void compact_success() throws Exception {

  // The encoded header -- the part before the first dot -- is copied from
  // https://tools.ietf.org/html/rfc7797#section-4.1.
  String expectedToken = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJibGFoIn0";
  ToBeSignedJwt token = new ToBeSignedJwt.Builder().setJwtId("blah").build();
  String compact = token.compact("HS256");
  assertThat(compact).isEqualTo(expectedToken);
}