null-проверка при парсинге JSON через JsonIter

private static class Test {
    @JsonProperty(value = "test", collectionValueNullable = false) Long[] test;

    @Override
    public String toString ( ) {
        return Arrays.toString(test);
    }
}

public static void main (String[] args) {
    String test = "{\"test\":[1,null,3]}";
    try {
        System.out.println(JsonIterator.deserialize(test, Test.class));
    } catch (Exception e) {
        e.printStackTrace( );
    }
}

Код не падает с ошибкой, а спокойно выводит [1, null, 3]. Что я делаю не так? Пробую:

private static class Test {
    @JsonProperty(value = "test", collectionValueNullable = false, nullable = false) Long[] test;

    @Override
    public String toString ( ) {
        return Arrays.toString(test);
    }
}

public static void main (String[] args) {
    String test = "{\"test\":null}";
    try {
        System.out.println(JsonIterator.deserialize(test, Test.class));
    } catch (Exception e) {
        e.printStackTrace( );
    }
}

И всё равно без ошибки выводит null.


Ответы (0 шт):