### Question:
NoneAlgorithm extends Algorithm { @Override public void verify(DecodedJWT jwt) throws SignatureVerificationException { byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature()); if (signatureBytes.length > 0) { throw new SignatureVerificationException(this); } } NoneAlgorithm(); @Override void verify(DecodedJWT jwt); @Override byte[] sign(byte[] headerBytes, byte[] payloadBytes); @Override @Deprecated byte[] sign(byte[] contentBytes);  }### Answer:
@Test public void shouldPassNoneVerification() throws Exception { Algorithm algorithm = Algorithm.none(); String jwt = "eyJhbGciOiJub25lIiwiY3R5IjoiSldUIn0.eyJpc3MiOiJhdXRoMCJ9."; algorithm.verify(JWT.decode(jwt)); }
@Test public void shouldFailNoneVerificationWhenTokenHasTwoParts() throws Exception { exception.expect(JWTDecodeException.class); exception.expectMessage("The token was expected to have 3 parts, but got 2."); String jwt = "eyJhbGciOiJub25lIiwiY3R5IjoiSldUIn0.eyJpc3MiOiJhdXRoMCJ9"; Algorithm algorithm = Algorithm.none(); algorithm.verify(JWT.decode(jwt)); }
@Test public void shouldFailNoneVerificationWhenSignatureIsPresent() throws Exception { exception.expect(SignatureVerificationException.class); exception.expectMessage("The Token's Signature resulted invalid when verified using the Algorithm: none"); String jwt = "eyJhbGciOiJub25lIiwiY3R5IjoiSldUIn0.eyJpc3MiOiJhdXRoMCJ9.Ox-WRXRaGAuWt2KfPvWiGcCrPqZtbp_4OnQzZXaTfss"; Algorithm algorithm = Algorithm.none(); algorithm.verify(JWT.decode(jwt)); }