Refactor Log4JFilter and improve branch coverage

This commit is contained in:
ljacqu
2015-11-20 23:17:50 +01:00
parent 019390dfe0
commit 84de22c9c0
3 changed files with 112 additions and 51 deletions
@@ -25,4 +25,16 @@ public class StringUtils {
// Determine the difference value, return the result
return Math.abs(service.score(first, second) - 1.0);
}
public static boolean containsAny(String str, String... pieces) {
if (str == null) {
return false;
}
for (String piece : pieces) {
if (str.contains(piece)) {
return true;
}
}
return false;
}
}