@Test public void testGetPropertiesNullNode() { Set<String> result = GrainsJsonPropertyUtil.getPropertySet(null); Assert.assertTrue(result.isEmpty()); }
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()); }
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()); } }
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(); }
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); }
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);  }