ValueJSON implements Value { public static Value of(String json) throws NullPointerException { Objects.requireNonNull(json, "json is required"); return new ValueJSON(json); } ValueJSON(String json); @Override Object get(); @Override T get(Class<T> clazz); @Override T get(TypeSupplier<T> typeSupplier); @Override boolean isInstanceOf(Class<?> typeClass); static Value of(String json); static Value of(Object json);  }
@Test public void shouldReturnErrorWhenElementIsNull() { assertThrows(NullPointerException.class, () -> ValueJSON.of(null)); }