class BeaconStateUtil {

  public static UInt64 get_total_balance(BeaconState state, Collection<Integer> indices) {
    UInt64 sum = UInt64.ZERO;
    SSZList<Validator> validator_registry = state.getValidators();
    for (Integer index : indices) {
      sum = sum.plus(validator_registry.get(index).getEffective_balance());
    }
    return sum.max(EFFECTIVE_BALANCE_INCREMENT);
  }

}