@Test
public void testSplitStateParam() {

  Optional<String> stateParam = Optional.of("RUNNING");
  assertEquals(Sets.newHashSet("RUNNING"), RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of("PAUSED,RUNNING");
  assertEquals(Sets.newHashSet("RUNNING", "PAUSED"), RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of("NOT_EXISTING");
  assertEquals(null, RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of("NOT_EXISTING,RUNNING");
  assertEquals(null, RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of("RUNNING,PAUSED,");
  assertEquals(Sets.newHashSet("RUNNING", "PAUSED"), RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of(",RUNNING,PAUSED,");
  assertEquals(Sets.newHashSet("RUNNING", "PAUSED"), RepairRunResource.splitStateParam(stateParam));
  stateParam = Optional.of("PAUSED ,RUNNING");
  assertEquals(Sets.newHashSet("RUNNING", "PAUSED"), RepairRunResource.splitStateParam(stateParam));
}