Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Over 20 years Java absorbed ideas from Guava, Joda-Time, Vavr and Lombok into the JDK (collections factories, java.time, records, pattern matching). What does this pattern mean for how you choose third-party libraries today?

The pattern means that a popular library is often a sign of a gap the JDK will fill later, so adopting it gives value now but creates a migration later. We therefore prefer libraries that are easy to remove: used narrowly, wrapped behind small interfaces and never exposed in public APIs. We watch the JDK roadmap, through projects such as Amber and Valhalla, to anticipate overlaps, budget for the migration when the JDK catches up, as many teams had to with Joda-Time to java.time, and encourage teams to use the platform first.

Why this question is asked

Anyone who has worked with Java for a long time has lived through this cycle more than once. Joda-Time was the way to handle dates until java.time arrived in Java 8, designed by the same lead author. Guava's immutable collections and Optional preceded List.of and java.util.Optional. Lombok's value classes preceded records, and Vavr's pattern matching preceded switch patterns. Interviewers ask this leadership question to see whether we learn from that history when choosing libraries today. In this answer, we will look at the pattern itself, what it costs, how to choose libraries that stay removable, how to read the JDK roadmap, and how to plan migrations.

1The Pattern: Libraries Show Where the JDK Has Gaps

The JDK evolves slowly and deliberately, because everything it adds must be supported for decades. Libraries move faster. When many projects adopt the same library, it shows the JDK designers a real need and gives them years of experience with one possible design. They then add a version to the platform, often simpler and sometimes different in important ways.

Library ideas the JDK absorbed
Library ideaJDK featureJava version
Joda-Timejava.time8 (2014)
Guava Optional, functional helpersjava.util.Optional, lambdas, streams8
Guava ImmutableList.ofList.of, Map.of, List.copyOf9 and 10
Guava Strings, Commons Lang helpersString.isBlank, strip, repeat11
Lombok @Valuerecords16
Vavr pattern matchingswitch with record and type patterns21
Async libraries for scalable I/Ovirtual threads21
The common pattern: a library proves the need, then the platform provides its own version.

Notice that the JDK versions are not always copies. java.time fixed design mistakes in Joda-Time, records are deliberately less flexible than Lombok's @Data, and List.of rejects null elements, unlike some library collections. So migrating is not a rename; it involves real behaviour differences, and that is where its cost comes from.

2What the Pattern Costs Us

Adopting a popular library early is usually right: it gives us years of value before the JDK catches up. The cost comes later, as a migration that nobody planned. Teams that used Joda-Time in every entity, DTO, JSON mapping and database converter faced a project touching hundreds of files to move to java.time, plus subtle differences in parsing and time zone handling. Teams that had used it only inside a date-handling module changed one module.

So the real cost of a library is not its adoption but how far it spreads. The same library can be cheap or expensive to leave depending on how we used it. That is the lesson that carries over to today's choices.

3Choosing Libraries That Are Easy to Remove

When we add a library, we should assume that one day we will remove it, either because the JDK catches up or because the project fades. That changes how we use it. We keep its usage narrow, to the module that needs it. Where its API would otherwise appear everywhere, we wrap it behind a small interface of our own. And we never expose its types in public APIs, entity fields or event schemas, because those are the places that spread furthest and are hardest to change.

Java
// Spread everywhere: library types in the domain and the API
public record Invoice(org.joda.time.LocalDate due, ...) {} // in JSON, DB mapping, tests
// Contained: our own type at the boundary, the library behind one class
public interface BusinessCalendar {
java.time.LocalDate addWorkingDays(java.time.LocalDate from, int days);
}
final class LibraryBusinessCalendar implements BusinessCalendar {
// the only class that imports the third-party calendar library
}

Notice that the second version would survive the library being replaced: only one class changes. This is not about wrapping every library, which would be wasteful for something like Jackson that is used through its own stable annotations. It is about recognising libraries that fill a platform gap and are likely to be absorbed, and containing them.

4Watching the JDK Roadmap

The JDK's future is visible years ahead. Features arrive through JEPs, JDK Enhancement Proposals, and usually go through incubator or preview releases before they are final. Large projects group related work: Amber delivers language productivity features such as records, sealed types and pattern matching; Loom delivered virtual threads and is finishing structured concurrency and scoped values; Valhalla is working on value classes, objects without identity that can be stored as compactly as primitives; Panama replaced much of JNI with the Foreign Function and Memory API.

A platform team should follow these projects and ask, before approving a library, whether a JDK feature is coming that covers the same need. If a team wants a library for value objects with special memory layout, Valhalla is relevant. If it wants a library for native calls, the Foreign Function API is already final since Java 22. The answer is not always to wait, but it changes how we adopt: knowing the replacement is coming, we contain the library more carefully.

5Budgeting for the Migration and Using the Platform First

When the JDK does catch up, the migration should be planned work, not an emergency. We record the library as a candidate for replacement, deprecate direct use of it for new code, and budget the migration over a few releases, ideally with automated refactoring such as OpenRewrite recipes, which exist for common moves like Joda-Time to java.time. Because the library was contained, the work is small.

The simplest guidance follows from all of this: use the platform first. Before adding a library, a team checks whether the JDK, or a dependency the platform already supports such as Spring, covers the need. Only when the gap is real does a library come in, contained and with an owner. This does not slow teams down much, because modern Java covers far more than it did in 2010.

Step throughDeciding on a library that fills a JDK gap
  1. Does the JDK or platform cover it?
    YesUse the platformNoConsider the library
  2. Is a JDK feature on the roadmap?
    YesAdopt, contain tightly, plan migrationNoAdopt with normal care
  3. Keep library types out of public APIswrap behind a small interface
  4. Review when the JDK feature is finalbudget the migration

4 steps in order. Play them, or step through them one at a time.

Every adopted library gets an exit plan in proportion to how likely the JDK is to absorb it.

6Follow-up questions

Does this mean we should avoid popular libraries?

No. They often give years of real value, and early adopters shaped the JDK's designs. The lesson is to adopt them in a way that keeps them removable, not to avoid them. Avoiding Joda-Time in 2010 would have meant years of painful java.util.Date code.

Which current libraries are likely candidates for absorption?

Libraries for value objects and compact data, which Valhalla targets, libraries for structured parallel tasks, which structured concurrency addresses, and some uses of Lombok that future Amber features, such as derived record creation, may cover. These are predictions to check against the roadmap, not certainties.

Should we migrate as soon as the JDK feature is final?

Not necessarily. We stop using the library in new code and migrate when the code is touched or when the library becomes a maintenance or security burden. A forced migration is only worth it when the library is unmaintained or blocks an upgrade.

7Conclusion

In this answer, we saw that Java repeatedly absorbs ideas from popular libraries such as Joda-Time, Guava, Lombok and Vavr, often with real differences in design. Adopting such libraries brings value now and a migration later, and the cost of that migration depends on how far the library spread. So we prefer libraries that are easy to remove, used narrowly behind small interfaces and kept out of public APIs, we follow the JDK roadmap in projects such as Amber, Loom and Valhalla, we budget for migrations, and we use the platform first.

What to say in the interviewAbout 80 seconds aloud

Open with

The pattern tells me two things. First, a very popular library is often a signal of a gap the JDK will eventually fill, as happened with Joda-Time and java.time, Guava's immutable collections and List.of, Lombok and records, and Vavr's pattern matching and switch patterns.

Then, if they want more

Second, adopting it was usually right, because it gave years of value, but the cost came later as a migration, and that cost depended on how far the library had spread. Teams with Joda types in every entity and API had a big project; teams that contained it had a small one.

So when I choose a library today, I prefer ones that are easy to remove: narrow usage, wrapped behind a small interface where its API would otherwise spread, and never exposed in public APIs or event schemas.

I follow the JDK roadmap, especially Amber for language features, Loom for concurrency and Valhalla for value classes, and before approving a library I ask whether a JDK feature is coming. When it arrives, I stop using the library for new code and budget the migration, using automated refactoring where recipes exist.

And the default guidance to teams is to check the platform first, since modern Java covers much more than it used to.

About this answer

Last updated
12 November 2026
Versions it names
Java 22, Java 8
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Over 20 years Java absorbed ideas from Guava, Joda-Time, Vavr and Lombok into the JDK...": https://scrivio-interview-library.netlify.app/java/utility-libraries/6bd3f51c17/