Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when you need to refactor Java code to adopt modern Java features (Java 8+) — including migrating anonymous classes to lambdas, replacing Iterator loops with Stream API, adopting Optional for null safety, switching from legacy Date/Calendar to java.time, using collection factory methods, applying text blocks, var inference, or leveraging Java 25 features like flexible constructor bodies and module import declarations. This should trigger for requests such as Review Java code for modern Java
.claude/skills/jabrena-141-java-refactoring-with-modern-features/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-05 | ✓→✗ | ▼ Worse | -29% | 0% |
| case-08 | ✓→✗ | ▼ Worse | -44% | 0% |
| case-22 | ✓→✗ | ▼ Worse | -33% | 0% |
Identify and apply modern Java (Java 8+) refactoring opportunities to improve readability, maintainability, and performance.
What is covered in this Skill?
Optional for null-safe APIsjava.time API (replacing Date/Calendar)var type inferenceList.of(), Set.of(), Map.of())Scope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Before applying any modern Java refactoring, ensure the project compiles. If compilation fails, stop immediately — do not proceed until the project compiles successfully. After applying improvements, run full verification.
./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.
Read references/141-java-refactoring-with-modern-features.md and identify high-value opportunities to adopt modern Java features.
Refactor incrementally using appropriate language/library features while preserving behavior and readability.
Run ./mvnw clean verify or mvn clean verify after applying improvements.
For detailed guidance, examples, and constraints, see references/141-java-refactoring-with-modern-features.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 4,873 | 4,987 | +2% | 1 | 1 | 0% | 219 | 884 | +304% | 0 | 0 | — |
case-02 | fail→fail | 4,945 | 5,694 | +15% | 1 | 1 | 0% | 245 | 934 | +281% | 0 | 0 | — |
case-03 | fail→fail | 5,369 | 5,459 | +2% | 1 | 1 | 0% | 244 | 914 | +275% | 0 | 0 | — |
case-04 | fail→fail | 9,503 | 5,967 | -37% | 1 | 1 | 0% | 1,692 | 910 | -46% | 0 | 0 | — |
case-05 | pass→fail | 7,028 | 5,241 | -25% | 1 | 1 | 0% | 1,082 | 767 | -29% | 0 | 0 | — |
case-06 | fail→fail | 11,392 | 3,494 | -69% | 1 | 1 | 0% | 1,998 | 978 | -51% | 0 | 0 | — |
case-07 | pass→pass | 5,439 | 7,006 | +29% | 1 | 1 | 0% | 933 | 1,828 | +96% | 0 | 0 | — |
case-08 | pass→fail | 9,145 | 5,213 | -43% | 1 | 1 | 0% | 1,610 | 894 | -44% | 0 | 0 | — |
case-09 | pass→pass | 9,432 | 6,391 | -32% | 1 | 1 | 0% | 1,552 | 1,676 | +8% | 0 | 0 | — |
case-10 | pass→pass | 9,140 | 5,778 | -37% | 1 | 1 | 0% | 1,536 | 1,509 | -2% | 0 | 0 | — |
case-11 | pass→pass | 3,329 | 5,112 | +54% | 1 | 1 | 0% | 459 | 1,397 | +204% | 0 | 0 | — |
case-12 | fail→pass | 5,828 | 1,760 | -70% | 1 | 1 | 0% | 791 | 875 | +11% | 0 | 0 | — |
case-13 | pass→pass | 3,722 | 4,668 | +25% | 1 | 1 | 0% | 562 | 1,462 | +160% | 0 | 0 | — |
case-14 | pass→pass | 7,802 | 8,346 | +7% | 1 | 1 | 0% | 1,379 | 2,017 | +46% | 0 | 0 | — |
case-15 | pass→pass | 12,668 | 8,031 | -37% | 1 | 1 | 0% | 1,978 | 1,816 | -8% | 0 | 0 | — |
case-16 | pass→pass | 9,840 | 4,320 | -56% | 1 | 1 | 0% | 1,562 | 1,283 | -18% | 0 | 0 | — |
case-17 | fail→fail | 4,192 | 1,662 | -60% | 1 | 1 | 0% | 608 | 853 | +40% | 0 | 0 | — |
case-18 | fail→pass | 6,784 | 2,178 | -68% | 1 | 1 | 0% | 894 | 917 | +3% | 0 | 0 | — |
case-19 | pass→pass | 4,299 | 3,624 | -16% | 1 | 1 | 0% | 623 | 1,215 | +95% | 0 | 0 | — |
case-20 | pass→pass | 5,724 | 5,423 | -5% | 1 | 1 | 0% | 1,005 | 1,465 | +46% | 0 | 0 | — |
case-21 | pass→pass | 11,469 | 6,662 | -42% | 1 | 1 | 0% | 2,126 | 1,795 | -16% | 0 | 0 | — |
case-22 | pass→fail | 13,274 | 9,666 | -27% | 1 | 1 | 0% | 2,314 | 1,554 | -33% | 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 16 counted toward the lift figure. The other 6 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 -5 percentage points is the difference between those two pass rates over the 16 comparable cases. 3 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.