### Question:
JsonObjectBuilderImpl implements JsonObjectBuilder, Serializable { public void add(final String name, final Object value) { if (value instanceof JsonValue) { add(name, (JsonValue) value); } else if (value instanceof BigDecimal) { add(name, (BigDecimal) value); } else if (value instanceof BigInteger) { add(name, (BigInteger) value); } else if (value instanceof Boolean) { add(name, (boolean) value); } else if (value instanceof Double) { add(name, (double) value); } else if (value instanceof Integer) { add(name, (int) value); } else if (value instanceof Long) { add(name, (long) value); } else if (value instanceof String) { add(name, (String) value); } else if (value == null) { addNull(name); } else if (value instanceof Map) { add(name, new JsonObjectBuilderImpl(Map.class.cast(value), bufferProvider).build()); } else if (value instanceof Collection) { add(name, new JsonArrayBuilderImpl(Collection.class.cast(value), bufferProvider).build()); } else if (value.getClass().isArray()) { final Collection<Object> collection = ArrayUtil.newCollection(value); add(name, new JsonArrayBuilderImpl(collection, bufferProvider).build()); } else { throw new JsonException("Illegal JSON type! name=" + name + " type=" + value.getClass()); } } protected  JsonObjectBuilderImpl();  JsonObjectBuilderImpl(final JsonObject initialData,
                                 final BufferStrategy.BufferProvider<char[]> bufferProvider);  JsonObjectBuilderImpl(final Map<String, Object> initialValues,
                                 final BufferStrategy.BufferProvider<char[]> bufferProvider); void add(final String name, final Object value); @Override JsonObjectBuilder add(final String name, final JsonValue value); @Override JsonObjectBuilder add(final String name, final String value); @Override JsonObjectBuilder add(final String name, final BigInteger value); @Override JsonObjectBuilder add(final String name, final BigDecimal value); @Override JsonObjectBuilder add(final String name, final int value); @Override JsonObjectBuilder add(final String name, final long value); @Override JsonObjectBuilder add(final String name, final double value); @Override JsonObjectBuilder add(final String name, final boolean value); @Override JsonObjectBuilder addNull(final String name); @Override JsonObjectBuilder add(final String name, final JsonObjectBuilder builder); @Override JsonObjectBuilder add(final String name, final JsonArrayBuilder builder); @Override JsonObjectBuilder addAll(JsonObjectBuilder builder); @Override JsonObjectBuilder remove(String name); @Override JsonObject build();  }### Answer:
@Test(expected = NullPointerException.class) public void testNullCheckValue() { final JsonObjectBuilder builder = Json.createObjectBuilder(); builder.add("a", (Integer) null); }
@Test(expected = NullPointerException.class) public void testNullCheckName() { final JsonObjectBuilder builder = Json.createObjectBuilder(); builder.add(null, "b"); }