### Question:
Selectors { public static Optional<String> optionalTextAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Optional.empty(); } if (!node.isTextual()) { throw new WrongTypeException(pointer, "not a string"); } return Optional.of(node.asText()); }  static String textAt(JsonNode node, JsonPointer pointer); static Optional<String> optionalTextAt(JsonNode node, JsonPointer pointer); static int integerAt(JsonNode node, JsonPointer pointer); static long longAt(JsonNode node, JsonPointer pointer); static OptionalInt optionalIntegerAt(JsonNode node, JsonPointer pointer); static Iterable<? extends JsonNode> listAt(JsonNode node, JsonPointer pointer); static List<String> textListAt(JsonNode node, JsonPointer pointer); static Map<String, String> propertiesAt(JsonNode node, JsonPointer pointer); static Map<String, Long> longPropertiesAt(JsonNode node, JsonPointer pointer);  }### Answer:
@Test public void emptyOptionalTextAt() { ObjectNode node = newObject(); Optional<String> value = Selectors.optionalTextAt(node, FOO_FIELD); assertThat(value, is(Optional.empty())); }
@Test public void nonEmptyOptionalTextAt() { ObjectNode node = newObject(); node.put("foo", "bar"); Optional<String> value = Selectors.optionalTextAt(node, FOO_FIELD); assertThat(value, is(Optional.of("bar"))); }