Mockito Example with Best Practices

In this lesson, we will study Mockito, a full fledged framework in Java to create test doubles or mocks. Table of ContentsIntroductionTerminologiesAdding to classpath, using MavenUsing Mockito APIWith @RunWith(MockitoJUnitRunner.class)With MockitoRuleBest practices with MockitoReadabilityBreak EverythingIgnore Trivial …

5 best java programming books

For nearly a decade Java has continued to be one of the most popular programming languages. Java is extensively used for the back-end infrastructure of business applications, web applications, and embedded systems. It is the …

Power function in java

Power function in java is used to get first argument’s power to 2nd argument. For example: Let’s say you want to calculate 2 to the power 4. That will be 2*2*2*2=16 In java, you can …

Java Math random example

In this post, we will see about Java math random example. Math’s random method provides you positive signed double value from 0.0 to 1.0. Syntax This method can be used in multithreaded environment as …

Java Math floor example

Java math floor function is used to get largest integer which is lesser than number. Syntax Example Let’s use math’s floor function in the example. When you run above program, output of the …

Java Math ceil example

Java math ceil function is used to get smallest integer which is greater than number. Real life example Let’s say a telephone company charges you 1 dollar per minute. When you talk to someone for …

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog