boolean (String @Nullable [] parts, @Nullable String path) { if (parts == null || path == null) { return false; } for (String part : parts) { if (path.contains(part)) { return true; } } return false; }