AbstractO2AuthenticationFilter implements ContainerRequestFilter { protected final Entry<BigInteger, String> convertCredentials( final String rawId, final String rawSecret) { try { String secret = Strings.emptyToNull(rawSecret); return Optional .ofNullable(rawId) .map(IdUtil::fromString) .map(id -> new SimpleEntry<>(id, secret)) .orElse(null); } catch (NumberFormatException e) { return null; } } AbstractO2AuthenticationFilter(
            final Provider<ContainerRequest> requestProvider,
            final Provider<Session> sessionProvider);   }
@Test public void convertCredentials() { BigInteger validId = IdUtil.next(); String validRawId = IdUtil.toString(validId); assertNull(testFilter .convertCredentials(null, "secret")); assertNull(testFilter .convertCredentials("malformed", "secret")); assertEquals(new SimpleEntry<>(validId, "secret"), testFilter.convertCredentials(validRawId, "secret")); assertEquals(new SimpleEntry<>(validId, null), testFilter.convertCredentials(validRawId, null)); assertEquals(new SimpleEntry<>(validId, null), testFilter.convertCredentials(validRawId, "")); }