Tag Archives: Java

Simple algorithm for casting strings to double

The article describes a method for converting incorrectly formatted numeric strings in CSV files into doubles by replacing commas with dots and handling various input errors, complemented by a Java util class implementation and tests. Continue reading

Posted in Solutions | Tagged , , , | Leave a comment

How to make multipart requests with file and object through autogenerated code defined in OpenAPI

This article explains how to create a Spring Boot endpoint using OpenAPI to receive objects and, optionally, files through multipart form data, focusing on deserialization and validation of incoming objects. Continue reading

Posted in Solutions | Tagged , , , , , , , , , , , , , | Leave a comment

How to compile and run Java files on Windows

There are several scenarios when you need to compile and run your Java code from the terminal or command prompt on Windows. Here is a tutorial on how to do it. Continue reading

Posted in Language basics | Tagged , | Leave a comment

7 different ways how to get NumberFormatException in Java

This article will show you the NumberFormatException, how you are getting it and what you should do to handle the exception properly. Continue reading

Posted in Language basics | Tagged , , , | Leave a comment

How to figure out if a character in a string is a number

This article is about multiple ways to pull a character from a string and check if it is a number. Continue reading

Posted in Tips & tricks | Tagged , , , , , , | Leave a comment

How To Turn Number To String With Padded Space or Zeroes

Article about a simple solution to turning numbers into specific length String with padded space. Continue reading

Posted in Tips & tricks | Tagged , , , | Leave a comment

Flattening Stream Collections in Java

This article is about flattening the list of element list with use of Java 8 stream feature flatMap and forEach Continue reading

Posted in Language basics | Tagged , , | Leave a comment

Selenium – remove html element from the DOM

This article will show you how to remove elements from HTML DOM (Document Object Model) when using automated web-browser framework Selenium. Continue reading

Posted in Tutorials | Tagged , , , , , , , | Leave a comment

How to print current project classpath

This article is a short explanation of a classpath and a single line of Java code that will help you print out your classpath. Continue reading

Posted in Tips & tricks | Tagged , , | Leave a comment

Verify method was called n-times with Mockito

Mockito Verify example for n-times calls using various verification modes. Continue reading

Posted in Testing | Tagged , , , | Leave a comment