Java Engineers can adopt several strategies to stay up-to-date with technology. One of the most natural ones is by developing frameworks and libraries. By doing that, they often find themselves in one of these two situations: Any significant change in their code would break their… Read More »3 principles to apply in your Java APIs and stay up-to-date with technology
Creating intuitive APIs is a very important skill for you to reduce the chances of bugs and make your software more maintainable. When you don’t create intuitive APIs, your code becomes error prone and the developers (including you) may misuse an API. Let’s see an… Read More »Creating More Intuitive Java APIs With Optional
The new LTS version (version 17) of Java was released in September. And since the previous LTS (version 11), many cool features were added. One of the coolest ones is “Pattern Matching for instanceof“. Until Java 15, when we checked whether an object is an… Read More »How to Use Pattern Matching for instanceof From JDK16
Mapping items from a List means that each item from that List will be converted into another object. Reducing items from a List means that all items from that List will be combined into a single object, which doesn’t necessarily have the same type as… Read More »How to Map and Reduce Items From a List in Java
When you need to test an application that consumes a web API, you basically have two options: Use Testcontainers to start a container that will run the web API which your application will consume. Mock a Web Server to emulate the web API which your… Read More »How to Mock a Web Server Using WireMock in Your Java Applications
If you need to reverse the character order of a String, you can use StringBuilder to do that. Note that the following code prints: Java is great! If you have any questions, leave a comment or send me a message on my social media.
Usually, Java developers instantiate Maps using HashMap as implementation. Did you know HashMap doesn’t keep the order of insertion? Look at the following example: If we run the example above, the following output will be printed: So, if you want to keep the elements in… Read More »How to Keep the Elements of a Map in the Same Order That They Were Inserted
Here’s how to find the maximum value from a Collection in Java. If you have any questions, leave a comment or ask me on my social media.
Here’s how to split Strings in Java. If you have any questions, leave a comment or ask me on my social media.
Here’s how to join Strings in Java. If you have any questions, leave a comment or ask me on my social media.
See what happens when you pass a double as argument when constructing BigDecimal objects in Java. If you have any questions, leave a comment or ask me on my social media.