Got rid of the AvoidInstantiatingObjectsInLoops-PMD warning.