Practical Refactoring to Modern Java

How to use the many new Java features that have been added since Java 11

A fast, hands-on refactoring workshop for experienced Java developers who haven't yet adopted Java 11-25 features. For each feature, we give a crisp "what/why," then immediately modernize real ERP code to show concrete benefits: safer hierarchies, cleaner APIs, leaner strings, smarter patterns, and simpler imports. You'll leave with a repeatable checklist to upgrade legacy codebases pragmatically and safely.

  • Real-World Refactoring, Not Toy Examples: Modern Java features are applied to a legacy ERP system, demonstrating how to improve production-grade code - not just contrived code snippets.
  • Fast-Paced, Feature-Rich, Hands-On: Covers 16 major enhancements from Java 10 to 25 in just 1 day, with short focused refactoring exercises that cement understanding through direct application.
  • Designed for Busy Professionals: Zero fluff, just practical modernization - ideal for experienced Java developers who need a guided tour of Java's evolution without wading through specifications or reading dozens of blog posts.

By the end of this class, you'll be able to:

  • Systematically modernize legacy ERP code by applying Java 11-25 features in-place (e.g., var, text blocks, switch expressions, records, instanceof/record/switch pattern matching, sequenced collections).
  • Redesign data and type hierarchies using records and sealed classes, then leverage exhaustive pattern matching to simplify business logic and eliminate casts/fallthrough bugs.
  • Streamline pipelines and APIs with Stream Gatherers and unnamed variables/patterns, reducing incidental complexity in service, finder, and rendering layers.
  • Adopt Java 25 ergonomics safely at scale-validate early with flexible constructor bodies (JEP 513), use instance main/IO where suitable (JEP 512), and employ module import declarations (JEP 511) while avoiding name ambiguities.

Detailed Outline

Part 0: Welcome
Session 1 - Readability & Brevity (Java 10-15)
  • Local variable type inference (var) - JEP 286/323
    • Goal: Reduce noise; discuss when not to use var.
  • String.repeat() - Java 11
    • Goal: Replace manual loops/joins for repeated chars.
  • Switch expressions - JEP 361 (Java 14)
    • Goal: Eliminate fallthrough bugs; return values from switch.
  • Text blocks - JEP 378 (Java 15)
    • Goal: Readable multi-line strings without escaping.
Session 2 - Lightweight Data & Safer Hierarchies (Java 16-18)
  • Records - JEP 395 (Java 16)
    • Goal: Remove boilerplate; discuss encapsulation trade-offs.
  • Pattern matching for instanceof - JEP 394 (Java 16)
    • Goal: Inline safe casts; reduce duplication.
  • Sealed classes - JEP 409 (Java 17)
    • Goal: Constrain subtypes; expose hierarchy bugs early.
  • Code snippets in Javadoc - JEP 413 (Java 18)
    • Goal: Use {@snippet ...} for accurate, styled examples.
Session 3 - Collections & Pattern Power (Java 21-22)
  • Sequenced collections - JEP 431 (Java 21)
    • Goal: Replace get(0)/size()-1 with getFirst()/getLast(); unify deque/list APIs.
  • Record patterns - JEP 440 (Java 21)
    • Goal: Deconstruct records directly in conditionals.
  • Pattern matching for switch - JEP 441 (Java 21)
    • Goal: Replace cascaded instanceof ladders with concise switch.
  • Unnamed variables & patterns - JEP 456 (Java 22)
    • Goal: Use _ for ignored lambda params / record components.
Session 4 - Pipelines, Constructors & Modules (Java 24-25)
  • Stream Gatherers - JEP 485 (Java 24)
    • Goal: Custom mid-stream logic (stateful transforms, error handling).
  • Flexible constructor bodies - JEP 513 (Java 25)
    • Goal: Validate/assign before super()
  • Compact source & instance main + IO - JEP 512 (Java 25)
    • Goal: Understand compact demos; adopt IO for cleaner output.
  • Module import declarations - JEP 511 (Java 25)
    • Goal: Import entire modules; manage ambiguities (java.util.Date vs java.sql.Date).

Your Instructor


Dr Heinz M. Kabutz
Dr Heinz M. Kabutz

Heinz Kabutz is the author of The Java Specialists’ Newsletter, a publication enjoyed by tens of thousands of Java experts in over 150 countries. He has been a Java Champion since 2005.


Course Curriculum


  15. Compact Source Files and Instance Main Methods (Java 25, JEP 512)
Available in days
days after you enroll
  17. The End
Available in days
days after you enroll

Frequently Asked Questions


How long do I have access to a fully paid course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own. Furthermore, if we move to another platform, we will offer you a free transfer of your account for all the courses that you have purchased.
Can I pay via PayPal?
Yes, you can for outright purchases, but not for recurring payments such as paying by installments.
Can I get back the EU VAT?
Absolutely. First off, be sure to enter the VAT number in the appropriate field during the payment process. Then contact Teachable and ask them to reimburse you the VAT.
May I share my login details with my colleagues?
Unfortunately not. The terms of usage are for a single license. Teachable tracks your progress through the curriculum, so you won't know how much you have watched. We offer discounts on bulk licenses by one company. Please contact us for bulk licensing.
May we use the course for running in-house courses?
You may, as long as each of the students in the class has a valid license for that course. For example, some companies run lunch time Design Patterns study groups using our material. This is an effective way to learn. Please contact us for bulk licensing.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 14 days to tell us what you are unhappy about, and we will give you a full refund and deregister you from the course.
When does the course start and finish?
The course starts now and never ends! It is a completely self-paced online course - you decide when you start and when you finish. We do recommend putting time aside and setting goals to complete the course.
Can I watch the course offline during my commute?
Teachable have an iOS app that lets you watch offline. Android is not supported unfortunately.

Get started now!