Identify and apply functional programming principles in Java to improve immutability, expressiveness, and maintainability.
Prerequisites: Run ./mvnw compile or mvn compile before applying any changes. If compilation fails, stop immediately — do not proceed until the project compiles successfully. Also verify that the project's maven-compiler-plugin source/target supports the Java features being used.
Core areas: Immutable objects and Records (JEP 395), pure functions free of side effects, functional interfaces (Function, Predicate, Consumer, Supplier) and custom @FunctionalInterface types, lambda expressions and method references, Stream API (filter/map/reduce pipelines, parallel streams, toUnmodifiable collectors), Optional idiomatic usage (map/flatMap/filter/orElse over isPresent()+get()), function compositi...
불변 객체 및 레코드 작성, 순수 함수, 함수형 인터페이스, 람다 식, 스트림 API 파이프라인, null 안전을 위한 선택 사항, 함수 구성, 고차 함수, 인스턴스 및 스위치에 대한 패턴 일치, 제어된 계층 구조를 위한 봉인된 클래스/인터페이스, 사용자 지정 작업을 위한 스트림 수집기, 커링/부분 적용, 효과 경계 분리 및 동시 안전 함수 패턴을 포함하여 Java에서 함수형 프로그래밍 원칙을 적용해야 할 때 사용합니다. Skills-for-Java 프로젝트의 일부 출처: jabrena/cursor-rules-java.