Source:
<code>private void validateExpectedClaims(Header header, Claims claims) { for (String expectedClaimName : expectedClaims.keySet()) { Object expectedClaimValue = expectedClaims.get(expectedClaimName); Object actualClaimValue = claims.get(expectedClaimName); if (Claims.ISSUED_AT.equals(expectedClaimName)) { <START> expectedClaimValue = expectedClaims.getIssuedAt(); <END> actualClaimValue = claims.getIssuedAt(); } else if (Claims.EXPIRATION.equals(expectedClaimName)) { expectedClaimValue = expectedClaims.getExpiration(); actualClaimValue = claims.getExpiration(); } else if (Claims.NOT_BEFORE.equals(expectedClaimName)) { expectedClaimValue = expectedClaims.getNotBefore(); actualClaimValue = claims.getNotBefore(); } else if (expectedClaimValue instanceof Date && actualClaimValue != null && actualClaimValue instanceof Long) { actualClaimValue = new Date((Long)actualClaimValue); } InvalidClaimException invalidClaimException = null; if (actualClaimValue == null) { String msg = String.format( ClaimJwtException.MISSING_EXPECTED_CLAIM_MESSAGE_TEMPLATE, expectedClaimName, expectedClaimValue ); invalidClaimException = new MissingClaimException(header, claims, msg); } else if (!expectedClaimValue.equals(actualClaimValue)) { String msg = String.format( ClaimJwtException.INCORRECT_EXPECTED_CLAIM_MESSAGE_TEMPLATE, expectedClaimName, expectedClaimValue, actualClaimValue ); invalidClaimException = new IncorrectClaimException(header, claims, msg); } if (invalidClaimException != null) { invalidClaimException.setClaimName(expectedClaimName); invalidClaimException.setClaimValue(expectedClaimValue); throw invalidClaimException; } } }</code><technical_language>I need 3 separate if statements if get(name,date) method is adjusted mentioned above</technical_language>

Target:
private void validateExpectedClaims(Header header, Claims claims) { for (String expectedClaimName : expectedClaims.keySet()) { Object expectedClaimValue = expectedClaims.get(expectedClaimName); Object actualClaimValue = claims.get(expectedClaimName); if ( Claims.ISSUED_AT.equals(expectedClaimName) || Claims.EXPIRATION.equals(expectedClaimName) || Claims.NOT_BEFORE.equals(expectedClaimName) ) { expectedClaimValue = expectedClaims.get(expectedClaimName, Date.class); actualClaimValue = claims.get(expectedClaimName, Date.class); } else if ( expectedClaimValue instanceof Date && actualClaimValue != null && actualClaimValue instanceof Long ) { actualClaimValue = new Date((Long)actualClaimValue); } InvalidClaimException invalidClaimException = null; if (actualClaimValue == null) { String msg = String.format( ClaimJwtException.MISSING_EXPECTED_CLAIM_MESSAGE_TEMPLATE, expectedClaimName, expectedClaimValue ); invalidClaimException = new MissingClaimException(header, claims, msg); } else if (!expectedClaimValue.equals(actualClaimValue)) { String msg = String.format( ClaimJwtException.INCORRECT_EXPECTED_CLAIM_MESSAGE_TEMPLATE, expectedClaimName, expectedClaimValue, actualClaimValue ); invalidClaimException = new IncorrectClaimException(header, claims, msg); } if (invalidClaimException != null) { invalidClaimException.setClaimName(expectedClaimName); invalidClaimException.setClaimValue(expectedClaimValue); throw invalidClaimException; } } }