### Question:
CsvLoaderUtils { static Optional<BusinessDayAdjustment> parseBusinessDayAdjustment( CsvRow row, String conventionField, String calendarField) { Optional<String> cnvOpt = row.findValue(conventionField); if (cnvOpt.isPresent()) { BusinessDayConvention cnv = LoaderUtils.parseBusinessDayConvention(cnvOpt.get()); if (cnv.equals(BusinessDayConventions.NO_ADJUST)) { return Optional.of(BusinessDayAdjustment.NONE); } Optional<String> calOpt = row.findValue(calendarField); if (calOpt.isPresent()) { HolidayCalendarId cal = HolidayCalendarId.of(calOpt.get()); return Optional.of(BusinessDayAdjustment.of(cnv, cal)); } } return Optional.empty(); } private  CsvLoaderUtils(); static Pair<YearMonth, EtdVariant> parseEtdVariant(CsvRow row, EtdType type); static EtdSettlementType parseEtdSettlementType(String str); static EtdOptionType parseEtdOptionType(String str); static DoublesPair parseQuantity(CsvRow row); static String formattedPercentage(double value); static String formattedDouble(double value); static final String SECURITY_ID_SCHEME_FIELD; static final String SECURITY_ID_FIELD; static final String EXCHANGE_FIELD; static final String CONTRACT_CODE_FIELD; static final String LONG_QUANTITY_FIELD; static final String SHORT_QUANTITY_FIELD; static final String QUANTITY_FIELD; static final String PRICE_FIELD; static final String EXPIRY_FIELD; static final String EXPIRY_WEEK_FIELD; static final String EXPIRY_DAY_FIELD; static final String SETTLEMENT_TYPE_FIELD; static final String EXERCISE_STYLE_FIELD; static final String VERSION_FIELD; static final String PUT_CALL_FIELD; static final String EXERCISE_PRICE_FIELD; static final String UNDERLYING_EXPIRY_FIELD; static final String CURRENCY; static final String TICK_SIZE; static final String TICK_VALUE; static final String CONTRACT_SIZE; static final int DEFAULT_OPTION_VERSION_NUMBER; static final ImmutableMap<String, EtdSettlementType> SETTLEMENT_BY_CODE; }### Answer:
@Test public void test_parseBusinessDayAdjustment() { ImmutableList<String> headers = ImmutableList.of("CNV", "CAL"); ImmutableList<String> firstRow = ImmutableList.of("F", "GBLO"); CsvRow row = CsvFile.of(headers, ImmutableList.of(firstRow)).row(0); assertThat(CsvLoaderUtils.parseBusinessDayAdjustment(row, "CNV", "CAL")) .isEqualTo(Optional.of(BusinessDayAdjustment.of(FOLLOWING, HolidayCalendarIds.GBLO))); }
@Test public void test_parseBusinessDayAdjustment_none() { ImmutableList<String> headers = ImmutableList.of("CNV", "CAL"); ImmutableList<String> firstRow = ImmutableList.of("NONE", "GBLO"); CsvRow row = CsvFile.of(headers, ImmutableList.of(firstRow)).row(0); assertThat(CsvLoaderUtils.parseBusinessDayAdjustment(row, "CNV", "CAL")).isEqualTo(Optional.of(BusinessDayAdjustment.NONE)); }
@Test public void test_parseBusinessDayAdjustment_notFound() { ImmutableList<String> headers = ImmutableList.of("CNV", "CAL"); ImmutableList<String> firstRow = ImmutableList.of("F", "GBLO"); CsvRow row = CsvFile.of(headers, ImmutableList.of(firstRow)).row(0); assertThat(CsvLoaderUtils.parseBusinessDayAdjustment(row, "CNV", "CAX")).isEqualTo(Optional.empty()); }