@Provides
  @PayloadGenerator.Payloads
  @Singleton
  ImmutableList<PayloadDefinition> provideParsedPayloads() throws IOException {
    // It is only safe to use SnakeYaml with SafeConstructor.
    // Parse the YAML by converting it into JSON and then into the proto message
    Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
    Map<String, Object> rawYamlData =
        yaml.load(
            Resources.toString(
                Resources.getResource(this.getClass(), "payload_definitions.yaml"),
                UTF_8));

    Gson gson = new Gson();
    String json = gson.toJson(rawYamlData);

    PayloadLibrary.Builder builder = PayloadLibrary.newBuilder();
    JsonFormat.parser().ignoringUnknownFields().merge(json, builder);
    PayloadLibrary parsed = builder.build();

    return validatePayloads(parsed.getPayloadsList());
  }
@Test
  public void provideParsedPayloads_returnsSomePayloads() throws IOException {
    ImmutableList<PayloadDefinition> payloads = module.provideParsedPayloads();

    assertThat(payloads).isNotEmpty();
  }