Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when you need to apply functional programming principles in Java — including writing immutable objects and Records, pure functions, functional interfaces, lambda expressions, Stream API pipelines, Optional for null safety, function composition, higher-order functions, pattern matching for instanceof and switch, sealed classes/interfaces for controlled hierarchies, Stream Gatherers for custom operations, currying/partial application, effect boundary separation, and concurrent-safe functional
.claude/skills/jabrena-142-java-functional-programming/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 45% | 0% |
| case-08 | ✓→✗ | ▼ Worse | -36% | 0% |
| case-11 | ✓→✗ | ▼ Worse | -33% | 0% |
| case-22 | ✓→✗ | ▼ Worse | -60% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 66% | 0% |
Identify and apply functional programming principles in Java to improve immutability, expressiveness, and maintainability.
What is covered in this Skill?
Function, Predicate, Consumer, Supplier, custom @FunctionalInterfacetoUnmodifiable* collectorsOptional idiomatic usage: map/flatMap/filter/orElse* over isPresent()+get()andThen/composeinstanceof and switch (Java 21)List.of(), Collectors.toUnmodifiableList()Scope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Before applying any functional programming changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until the project compiles successfully. Verify that maven-compiler-plugin source/target supports the Java features being used.
./mvnw compile or mvn compile before applying any changes./mvnw clean verify or mvn clean verify after applying improvementsRun ./mvnw compile or mvn compile and stop immediately if compilation fails.
Verify maven-compiler-plugin source/target supports the functional features planned for adoption.
Read references/142-java-functional-programming.md and identify opportunities for immutability, pure functions, and functional composition.
Implement selected functional refactorings while keeping side effects at boundaries.
Run ./mvnw clean verify or mvn clean verify after applying improvements.
For detailed guidance, examples, and constraints, see references/142-java-functional-programming.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 6,587 | 5,642 | -14% | 1 | 1 | 0% | 1,111 | 1,045 | -6% | 0 | 0 | — |
case-02 | fail→fail | 8,835 | 5,554 | -37% | 1 | 1 | 0% | 1,455 | 1,016 | -30% | 0 | 0 | — |
case-03 | fail→pass | 5,352 | 1,930 | -64% | 1 | 1 | 0% | 705 | 1,023 | +45% | 0 | 0 | — |
case-04 | pass→pass | 4,927 | 3,501 | -29% | 1 | 1 | 0% | 801 | 1,326 | +66% | 0 | 0 | — |
case-05 | pass→pass | 9,190 | 8,886 | -3% | 1 | 1 | 0% | 1,645 | 2,208 | +34% | 0 | 0 | — |
case-06 | pass→pass | 6,449 | 4,734 | -27% | 1 | 1 | 0% | 1,130 | 1,571 | +39% | 0 | 0 | — |
case-07 | pass→pass | 11,531 | 10,167 | -12% | 1 | 1 | 0% | 2,073 | 2,227 | +7% | 0 | 0 | — |
case-08 | pass→fail | 9,907 | 5,860 | -41% | 1 | 1 | 0% | 1,684 | 1,072 | -36% | 0 | 0 | — |
case-09 | pass→pass | 15,374 | 11,811 | -23% | 1 | 1 | 0% | 2,428 | 2,686 | +11% | 0 | 0 | — |
case-10 | pass→pass | 8,962 | 7,737 | -14% | 1 | 1 | 0% | 1,522 | 2,008 | +32% | 0 | 0 | — |
case-11 | pass→fail | 8,912 | 4,429 | -50% | 1 | 1 | 0% | 1,411 | 951 | -33% | 0 | 0 | — |
case-12 | pass→pass | 7,067 | 7,271 | +3% | 1 | 1 | 0% | 1,206 | 1,938 | +61% | 0 | 0 | — |
case-13 | pass→pass | 4,793 | 5,444 | +14% | 1 | 1 | 0% | 795 | 1,605 | +102% | 0 | 0 | — |
case-14 | pass→pass | 4,994 | 1,990 | -60% | 1 | 1 | 0% | 711 | 1,033 | +45% | 0 | 0 | — |
case-15 | pass→pass | 2,728 | 2,813 | +3% | 1 | 1 | 0% | 418 | 1,154 | +176% | 0 | 0 | — |
case-16 | pass→pass | 4,457 | 3,955 | -11% | 1 | 1 | 0% | 822 | 1,477 | +80% | 0 | 0 | — |
case-17 | pass→pass | 3,591 | 2,721 | -24% | 1 | 1 | 0% | 540 | 1,147 | +112% | 0 | 0 | — |
case-18 | pass→pass | 10,090 | 10,649 | +6% | 1 | 1 | 0% | 1,622 | 2,360 | +45% | 0 | 0 | — |
case-19 | pass→pass | 9,629 | 10,813 | +12% | 1 | 1 | 0% | 1,702 | 2,251 | +32% | 0 | 0 | — |
case-20 | pass→pass | 19,528 | 9,958 | -49% | 1 | 1 | 0% | 3,010 | 2,266 | -25% | 0 | 0 | — |
case-21 | pass→pass | 11,650 | 11,116 | -5% | 1 | 1 | 0% | 1,969 | 2,707 | +37% | 0 | 0 | — |
case-22 | pass→fail | 13,420 | 5,076 | -62% | 1 | 1 | 0% | 2,386 | 962 | -60% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 18 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -9 percentage points is the difference between those two pass rates over the 18 comparable cases. 4 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.