This would be better implemented by using the [Arrays.of](http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#asList%28T...%29) static method:

```
private static List<String> algorithms = Arrays.of(
    "approximate_diameter",
    "connected_component",
    ...
)
```

Then to use it do:

```
if (algorithms.contains(algorithm) { ... }
```