@SuppressWarnings("JdkObsolete")
    protected void addCustomProperties(Properties props) {
        Properties jMeterProperties = JMeterUtils.getJMeterProperties();
        @SuppressWarnings("unchecked")
        Enumeration<String> enums = (Enumeration<String>) jMeterProperties.propertyNames();
        while (enums.hasMoreElements()) {
            String key = enums.nextElement();
            if (key.startsWith("mail.")) {
                String value = jMeterProperties.getProperty(key);
                props.put(key, value);
            }
        }
    }
@Test
    public void testPassCustomProperties() {
        createJMeterEnv();
        Properties jMeterProperties = JMeterUtils.getJMeterProperties();
        jMeterProperties.put("prop1.name", "prop1.value");
        jMeterProperties.put("mail.prop2.name", "mail.prop2.value");

        MailReaderSampler sampler = new MailReaderSampler();
        Properties properties = new Properties();
        sampler.addCustomProperties(properties);
        Assertions.assertEquals(1, properties.size());
        Assertions.assertEquals("mail.prop2.value", properties.getProperty("mail.prop2.name"));
    }