Category: Java

The latest TIOBE index has Java language moving strongly into the #1 programming language for January 2016. If you’re not familiar with the TIOBE Index, it’s an index that looks at searches on the major search engines, blogs, forums, and Youtube (Did you know Youtube is now the second biggest search engine?) The “Popularity of […]Continue reading

Sorting an ArrayList is a common task in Java development. ArrayList is one of the most commonly used collection classes of the Java Collection Framework. Java provides a number of different ways to sort ArrayLists. In this post, we’ll explore the different ways to sort ArrayLists, and review best practices you should keep in mind. […]Continue reading

As a Java programmer, you will often need to work with date and time. In this post, we will learn how to get the current time of the day in Java applications. In Java, there are several ways for this and the primary classes that programmers typically use are the Date and Calendar classes. You can use both […]Continue reading

Unit tests should be small tests (atomic), lightweight, and fast. However, an object under test might have dependencies on other objects. It might need to interact with a database, communicate with a mail server, or talk to a web service or a message queue. All these services might not be available during unit testing. Even […]Continue reading

In the first part of the series on unit testing with JUnit, we looked at creating unit tests both using Maven and IntelliJ. In this post, we will look at some core unit testing concepts and apply those using JUnit constructs. We will learn about assertions, JUnit 4 annotations, and test suites. JUnit Assertions Assertions, […]Continue reading

Unit testing is the first level of testing software where you write test code that executes a specific functionality in the code to be tested. In most cases, you as a programmer are responsible to deliver unit tested code. The objective is to check if the unit of the software, for example a public method […]Continue reading