Achieve thread-safety with immutability

Immutability vs. mutability

Mutable objects are different control in a multi-threaded environment and are prone to cause strange bugs and unexpected behaviors in your code. We are going to investigate why it’s usually better to work with immutable objects and learn good design patterns to help you as a developer achieve immutability.

Continue Reading

Improve your JUnit tests with Mockito and PowerMock

Testing library Mockito

Have you ever felt that your code was difficult to test because of your classes, for example, depends on something external? A typical issue is that you have some class managing database operations and during your tests, you don’t want to query the database as it is usually considered out of scope from unit tests. Well, no worries Mockito has got you covered.

Continue Reading

Make your application more resilient with retries


Temporary hick-ups occurs from time to time and are quite difficult, if not impossible to entirely avoid. For example, if you are integrating with a REST service, or using a database to manage your data it is likely that at some point that your application won’t be able to reach the service or database. For example, Azure, which is considered to be a highly available service with almost no downtime can still only guarantee an uptime of 99.9%[1].

Continue Reading