public static Date toDate(final JsonNode node, final Date defaultValue) {
        if (node == null || !node.isTextual()) {
            return defaultValue;
        }
        final String text = node.asText();
        try {
            return DATE_FORMAT.parse(text);
        } catch (ParseException pe) {
            return defaultValue;
        }
    }
constructs a boolean value from a node. If node is null or not boolean, defaultValue is returned.
main/src/main/java/cgeo/geocaching/utils/JsonUtils.java