### Question:
YamlLoader { public Set<RoleMapping> load(final Resource resource) throws IOException { requireNonNull(resource); final Set<RoleMapping> result = new HashSet<>(); final Iterable<Object> mappings = initializeYaml().loadAll(resource.getInputStream()); for (final Object mapping : mappings) { result.add((RoleMapping) mapping); } return result; }  Set<RoleMapping> load(final Resource resource);  }### Answer:
@Test public void testLoadConfig() throws IOException { final Set<RoleMapping> mappings = new YamlLoader().load(new ClassPathResource("rbac.yaml")); assertThat(mappings.size(), is(2)); assertThat(mappings, hasItem(userRoleMapping)); assertThat(mappings, hasItem(adminRoleMapping)); }
@Test(expected = NullPointerException.class) public void testLoadConfigNull() throws IOException { new YamlLoader().load(null); fail(); }