Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long calendarTime = Calendar.getInstance().getTimeInMillis();
- LocalDateTime currentTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(calendarTime), ZoneId.systemDefault());
- try {
- if (orderSystem.getOrders().size() > 0) {
- orderSystem.getOrders().stream()
- .filter(order -> currentTime.isAfter(order.getExpirationDate()))
- .forEach(order -> {
- notificationService.popExpiredOrder(order);
- orderSystem.getOrders().remove(order);
- });
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement