import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public class PenghitungAman {
    public static void main(String[] args) {
        List<String> nama = List.of("Budi", "Siti", "Dewi");

        // Referensi jumlah tetap efektif final; ISI objeknya boleh berubah
        AtomicInteger jumlah = new AtomicInteger(0);

        nama.forEach(n -> {
            System.out.println("Memproses " + n);
            jumlah.incrementAndGet();
        });

        System.out.println("Total: " + jumlah.get());
    }
}
