### Question:
BasicHeader implements Header, Serializable { @Override public String getAlgorithm() { return algorithm; } BasicHeader(String algorithm, String type, String contentType, String keyId, Map<String, JsonNode> tree, ObjectReader objectReader); @Override String getAlgorithm(); @Override String getType(); @Override String getContentType(); @Override String getKeyId(); @Override Claim getHeaderClaim(String name);  }### Answer:
@Test public void shouldGetAlgorithm() throws Exception { BasicHeader header = new BasicHeader("HS256", null, null, null, null, objectReader); assertThat(header, is(notNullValue())); assertThat(header.getAlgorithm(), is(notNullValue())); assertThat(header.getAlgorithm(), is("HS256")); }
@Test public void shouldGetNullAlgorithmIfMissing() throws Exception { BasicHeader header = new BasicHeader(null, null, null, null, null, objectReader); assertThat(header, is(notNullValue())); assertThat(header.getAlgorithm(), is(nullValue())); }