Category Archives: library

Extracting substrings with StringUtils from the Apache library

Following on from some of my earlier posts, where I described some of the useful utils from the apache.commons.lang3 library (like that very nice RandomStringUtils class), this time I will focus a bit on the StringUtils class.  As the name suggests, it provides developers and testers an easy way to deal with certain String related operations. The class is quite large, so in this post I will cover the ‘substring’ category. As the name suggests, these methods deal with extracting substrings from a larger string, based on some conditions. Continue reading Extracting substrings with StringUtils from the Apache library

Working with lists: ImmutableList

When you are faced with a task that involves using lists, you might want to consider the following question: are the elements in my list ever going to change, or is it enough to just add my elements to the list once and use them across my tests. Is my list a constant? In case your elements will not change, you can use an ImmutableList to store them, which brings a major advantage: defining a list in one line. ImmutableList is part of the ‘guava’ library. Continue reading Working with lists: ImmutableList