### Question:
GrainsJsonPropertyUtil { public static Set<String> getPropertySet(JsonNode grainsProperty) { return Optional.ofNullable(grainsProperty) .map(JsonNode::elements) .map(IteratorUtils::toList) .map(jsonNodeList -> (Set<String>) jsonNodeList.stream() .map(item -> ((JsonNode) item).asText()) .collect(Collectors.toSet()) ).orElse(Collections.emptySet()); } private  GrainsJsonPropertyUtil(); static Set<String> getPropertySet(JsonNode grainsProperty);  }### Answer:
@Test public void testGetProperties() { Set<String> result = GrainsJsonPropertyUtil.getPropertySet(testNode); Assert.assertTrue(result.containsAll(resultSet)); }
@Test public void testGetPropertiesNullNode() { Set<String> result = GrainsJsonPropertyUtil.getPropertySet(null); Assert.assertTrue(result.isEmpty()); }
@Test public void testGetPropertiesEmptyNode() { Set<String> result = GrainsJsonPropertyUtil.getPropertySet(testNodeEmpty); Assert.assertTrue(result.isEmpty()); }