src/main/java/seedu/insurancepal/logic/parser/EditCommandParser.java
/**
     * Parses {@code Collection<String> insurances} into a {@code Set<Insurance>}
     * if {@code insurances} is non-empty.
     * If {@code insurances} contain only one element which is an empty string, it will be parsed into a
     * {@code Set<Insurance>} containing zero insurances.
     */
Parses  Collection insurances into a  Set
if  insurances is non-empty.
If  insurances contain only one element which is an empty string, it will be parsed into a
Set containing zero insurances.
Parses Collection insurances into a Set if insurances is non - empty . If insurances contain only one element which is an empty string it will be parsed into a Set containing zero insurances .
private Optional<Set<Insurance>> parseInsurancesForEdit(Collection<String> insurances)
            throws ParseException {
        assert insurances != null;
        if (insurances.isEmpty()) {
            return Optional.empty();
        }
        Collection<String> insuranceSet = insurances.size() == 1 && insurances.contains("")
                ? Collections.emptySet() : insurances;
        return Optional.of(ParserUtil.parseInsurances(insuranceSet));
    }
private Optional < Set < Insurance > > parseInsurancesForEdit ( Collection < String > insurances ) throws ParseException { assert insurances != null ; if ( insurances . isEmpty ( ) ) { return Optional . empty ( ) ; } Collection < String > insuranceSet = insurances . size ( ) == 1 && insurances . contains ( "" ) ? Collections . emptySet ( ) : insurances ; return Optional . of ( ParserUtil . parseInsurances ( insuranceSet ) ) ; }
Parses {@code Collection<String> insurances} into a {@code Set<Insurance>}
 if {@code insurances} is non-empty.
Parses { @code Collection<String > insurances } into a { @code Set<Insurance > } if { @code insurances } is non - empty .