@Test public void test_should_return_false_when_matching_tokens_is_null() { final Tokens tokens = new Tokens(null); final LocalDateTime now = LocalDateTime.now(ZoneId.of("UTC")); assertFalse(tokens.hasSingleNonExpiredToken(now)); }
public boolean hasSingleNonExpiredToken(LocalDateTime now) { return !CollectionUtils.isEmpty(tokens) && tokens.stream().anyMatch(token -> !token.isExpired(now)); }
Tokens { public boolean hasSingleNonExpiredToken(LocalDateTime now) { return !CollectionUtils.isEmpty(tokens) && tokens.stream().anyMatch(token -> !token.isExpired(now)); } }
Tokens { public boolean hasSingleNonExpiredToken(LocalDateTime now) { return !CollectionUtils.isEmpty(tokens) && tokens.stream().anyMatch(token -> !token.isExpired(now)); }  }
Tokens { public boolean hasSingleNonExpiredToken(LocalDateTime now) { return !CollectionUtils.isEmpty(tokens) && tokens.stream().anyMatch(token -> !token.isExpired(now)); }  boolean hasSingleNonExpiredToken(LocalDateTime now); Token getNonExpiredToken(LocalDateTime now); }
Tokens { public boolean hasSingleNonExpiredToken(LocalDateTime now) { return !CollectionUtils.isEmpty(tokens) && tokens.stream().anyMatch(token -> !token.isExpired(now)); }  boolean hasSingleNonExpiredToken(LocalDateTime now); Token getNonExpiredToken(LocalDateTime now);  }