public static FacilitySet from(Properties props) {

        Set<Facility> set = new HashSet<>();

        for (Facility facility : Facility.values()) {

            String onOrOff = props.getProperty(
                facility.name(),
                "OFF" //default value when facility is missing
            );

            if (onOrOff.equalsIgnoreCase("ON")) {
                set.add(facility);
            } else if (onOrOff.equalsIgnoreCase("OFF")) {
                //do nothing
            } else {
                throw new IllegalArgumentException(
                    "The property " + onOrOff + " for facility " + facility
                        + " is invalid.  The only valid values are \"ON\" or \"OFF\"."
                );
            }
        }

        return new FacilitySet(set);
    }
@Test
    public void testInvalidValueInFacilitySetFile() throws Exception {
        /*
         * Ensure we prohibit facility set properties files that contain bad values.
         */

        String TEST_FILE = "badFacilitySet.properties";

        Optional<File> file = FileUtils.getResourceAsFile(FacilitySetTest.class, TEST_FILE);

        assertTrue(file.isPresent());

        assertThrows(
            IllegalArgumentException.class,
            () -> FacilitySet.from(file.get().getAbsolutePath()),
            "Creating a facility set from an improperly formatted file should fail"
        );
    }