Writing Assertions for Collections using Hamcrest and JUnit

In this post, I will show you how to write assertions for Collections making use of the Hamcrest library when writing your JUnit testcases. The post provides some useful examples, and some important tips I've learned through experience.

Writing Assertions for Arrays using Hamcrest and JUnit

In this post, I will show you how to write assertions for Arrays making use of the Hamcrest library when writing your JUnit testcases. The post provides some useful examples, and some important tips I've learned through experience.

Writing Assertions for Numbers using Hamcrest and JUnit

In this post, I will show you how to write assertions for Numbers making use of the Hamcrest library when writing your JUnit testcases. The post provides some useful examples, and some important tips I've learned through experience.

Writing Assertions for Java Beans using Hamcrest and JUnit

In this post, I will show you how to write assertions for Java Objects making use of the Hamcrest library when writing your JUnit testcases. The post provides some useful examples, and some important tips I've learned through experience.

Building Alexa Skills – Example 1

This post is the first in the "Building an Alexa Skill" series where I will illustrate how to implement Alexa Skills. In this post, I will show you how to implement a simple "Hello World" Alexa skill making use of the Alexa Skills Kit (ASK) SDK for Java.

Counting Sort in Java

Counting Sort is an integer sorting algorithm. Counting Sort are unlike other sorting algorithms in that it makes certain assumptions about the data. It counts the number of objects with a a distinct key value, and use arithmetic to determine the position of each key. This algorithm does not make use of comparisons to sort the values. In simplistic terms, the algorithm counts the number of occurrences of each value in order to sort it.

Quick Sort Algorithm in Java

Quick Sort, also known as partition-exchange sort, is an efficient divide and conquer sorting algorithm. The algorithm can be implemented making use of loops or recursions. The algorithm performs the sorting in-place. Quick Sort is a comparison sort, meaning that it can sort items of any type for which a "less-than" relation is defined.

Merge Sort Algorithm in Java

Merge Sort is a divide and conquer algorithm as the algorithm split the original array into smaller logical sections. The algorithm can be implemented making use of loops or recursions. The two distinct phases are a splitting phase and secondly a merging phase.

Shell Sort Algorithm in Java

Shell Sort is an in-place comparison sort algorithm. Shell Sort is a generalization of insertion sort that allows the exchange of items that are far apart. The algorithm perform preliminary work by sorting pairs of elements far apart from each other. The algorithm progressively reduce the gap between elements to be compared as the goal is to reduce the amount of shifting of elements across the array. As the gap is reduced to 1, the algorithm becomes the same as the insertion sort algorithm.

Insertion Sort Algorithm in Java

Insertion sort is a sorting algorithm that builds the final sorted array (or list) one item at a time. The algorithm iterates over the list and removes the current element, finds the location within the sorted part of the list, and inserts it there. This process is repeated until the whole list is sorted.

Top