ВопросSeniorСТЭП ЛОДЖИК (STEP LOGIC)22 просмотраif (Boolean.TRUE.equals(bool)) { // check first key String firstKey = keys.iterator().next(); if (firstKey == "public") { keys.stream().forEach(key -> { // ... some logic log.warn("Using key " + key); }); } } public BookStoreController(BooksRepository repo, Boolean bool, List<String> keys) { this.repo = repo; if (Boolean.TRUE.equals(bool)) { // check first key String firstKey = (String) ((ArrayList) keys).get(0); if (firstKey == "public") { keys.stream().forEach(key -> { // ... some logic log.warn("Using key " + key); }); } } }