How to convert a String to an Int in Java? If the String contains only numbers, then the best way to convert the String to Int is by using Integer.parseInt() or Integer.valueOf(). If the String contains both numbers and characters, then… Read More »
Extract Numbers From String Using Java Regular Expressions
The following are examples which show how to extract numbers from a string using regular expressions in Java. Being able to parse strings and extract information from it is a key skill that every tester should have. This is particularly… Read More »
How to Loop Over ArrayList in Java
Looping over an ArrayList in Java. In this tutorial, we look at five different ways we can iterate through an ArrayList in Java. As of Java 8, we can use the forEach method as well as the iterator class to loop… Read More »
How to Parse JSON in Java
JSON stands for JavaScript Object Notation, and it is based on a subset of JavaScript. As a data-exchange format, it is widely used in web programming. Here we show how to parse JSON in Java using the org.json library. A JSON object… Read More »
How to Uninstall IntelliJ From Mac OS
In order to completely remove and uninstall IntelliJ from Mac OS, you need to delete the following directories and sub-directories: Uninstall IntelliJ from Mac OS Configuration (idea.config.path): ~/Library/Preferences/<PRODUCT><VERSION> Caches (idea.system.path): ~/Library/Caches/<PRODUCT><VERSION> Plugins (idea.plugins.path): ~/Library/Application Support/<PRODUCT><VERSION> Logs (idea.log.path): ~/Library/Logs/<PRODUCT><VERSION> Where PRODUCT would be… Read More »
Selenium WebDriver With Java 8 – Lambda Expressions and Collections Stream
From Selenium 3.0, minimum Java version is 8. In this article, we illustrate how to use Java 8 features like Lambda expression and Collections Stream to simplify Selenium WebDriver code. Lambda Expression Java lambda expressions are Java’s first step into… Read More »
How To Query For All Partition Keys in DynamoDB?
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. With DynamoDB, you can create database tables that can store and retrieve any amount of data, and serve any level of request… Read More »
How to Encode and Decode JSON Byte Array
The typical way to send binary in JSON is to base64 encode it. Java provides different ways to Base64 encode and decode a byte[]. One of these is DatatypeConverter. Suppose we have a JSON Array as listed below: {“menu”: { “id”:… Read More »
How to Get the Current Working Directory in Java
The current working directory means the root folder of your current Java project. We can get the current working directory in Java using the following system property function: String cwd = System.getProperty(“user.dir”); Example: public class CurrentWorkingDirectory { public static void… Read More »
How to Put Data in AWS Kinesis Stream With Java
Amazon Kinesis Streams enables you to build custom applications that process or analyze streaming data for specialized needs. Amazon Kinesis Streams can continuously capture and store terabytes of data per hour from hundreds of thousands of sources such as website… Read More »