code: public static Properties loadProperties(final ClassLoader loader, final String resource) {
          checkNotNull("loader", loader);
          checkNotNull("resource", resource);
  
          final Properties props = new Properties();
          try (final InputStream inStream = loader.getResourceAsStream(resource)) {
              if (inStream == null) {
                  throw new IllegalArgumentException("Resource '" + resource + "' not found!");
              }
              props.load(inStream);
          } catch (final IOException ex) {
              throw new RuntimeException(ex);
          }
          return props;
      }
docs: Loads a resource from the classpath as properties.
  
  @param loader
  Class loader to use.
  @param resource
  Resource to load.
  
  @return Properties.