class InitService {

  public InitState getInitState() throws EntityNotFoundException {
    List<InitState> initStates = Lists.newArrayList(initStateRepository.findAll());
    if (!initStates.isEmpty()) {
      InitState initState = initStates.get(0);
      initState.setRuntimeId(applicationContext.getId());
      return initState;
    } else {
      throw new EntityNotFoundException();
    }
  }

}