Since Java Properties are typically strings but derived from a Map<Object, Object> working with them in code is irritating. This example will demonstrate how to convert Properties to Map<String, String> using core java and guava Maps utility.
Straight up Java
A less than optimal approach is passing properties to the HashMap constructor while ignoring declaring the type. If you are following good programming practice you should declare @SuppressWarnings.
In this snippet, we will use a while loop to iterate and add property values to a Map<String, String>.
This snippet will show how to transform properties to a map using java 8 by first converting the entryset to a stream. Next calling the collect will reduce the stream to a map and the entryset key will be the map key and entry value the map value.
Guava Maps, a utility class pertaining to Map instances, contains a connivence method Maps.fromProperties which allows you to get a Map<String, String> out of Properties.