### Question:
JsonValueObjectEncoderContext implements ObjectEncoderContext, ValueEncoderContext { @NonNull @Override public ObjectEncoderContext inline(@Nullable Object value) throws IOException { return add(value, true); } JsonValueObjectEncoderContext(
      @NonNull Writer writer,
      @NonNull Map<Class<?>, ObjectEncoder<?>> objectEncoders,
      @NonNull Map<Class<?>, ValueEncoder<?>> valueEncoders,
      ObjectEncoder<Object> fallbackEncoder,
      boolean ignoreNullValues); private  JsonValueObjectEncoderContext(JsonValueObjectEncoderContext anotherContext); @NonNull @Override JsonValueObjectEncoderContext add(@NonNull String name, @Nullable Object o); @NonNull @Override JsonValueObjectEncoderContext add(@NonNull String name, double value); @NonNull @Override JsonValueObjectEncoderContext add(@NonNull String name, int value); @NonNull @Override JsonValueObjectEncoderContext add(@NonNull String name, long value); @NonNull @Override JsonValueObjectEncoderContext add(@NonNull String name, boolean value); @NonNull @Override ObjectEncoderContext inline(@Nullable Object value); @NonNull @Override ObjectEncoderContext nested(@NonNull String name); @NonNull @Override JsonValueObjectEncoderContext add(@Nullable String value); @NonNull @Override JsonValueObjectEncoderContext add(double value); @NonNull @Override JsonValueObjectEncoderContext add(int value); @NonNull @Override JsonValueObjectEncoderContext add(long value); @NonNull @Override JsonValueObjectEncoderContext add(boolean value); @NonNull @Override JsonValueObjectEncoderContext add(@Nullable byte[] bytes);  }### Answer:
@Test public void testInline_withNull_shouldThrow() { ObjectEncoder<DummyClass> objectEncoder = (o, ctx) -> ctx.inline(null); DataEncoder encoder = new JsonDataEncoderBuilder().registerEncoder(DummyClass.class, objectEncoder).build(); assertThrows(EncodingException.class, () -> encoder.encode(DummyClass.INSTANCE)); }
@Test public void testInline_withLong_shouldThrow() { ObjectEncoder<DummyClass> objectEncoder = (o, ctx) -> ctx.inline(Long.valueOf(100)); DataEncoder encoder = new JsonDataEncoderBuilder().registerEncoder(DummyClass.class, objectEncoder).build(); assertThrows(EncodingException.class, () -> encoder.encode(DummyClass.INSTANCE)); }
@Test public void testInline_withArray_shouldThrow() { ObjectEncoder<DummyClass> objectEncoder = (o, ctx) -> ctx.inline(new int[] {1, 2, 3}); DataEncoder encoder = new JsonDataEncoderBuilder().registerEncoder(DummyClass.class, objectEncoder).build(); assertThrows(EncodingException.class, () -> encoder.encode(DummyClass.INSTANCE)); }
@Test public void testInline_withDate_shouldThrow() { ObjectEncoder<DummyClass> objectEncoder = (o, ctx) -> ctx.inline(new Date()); DataEncoder encoder = new JsonDataEncoderBuilder().registerEncoder(DummyClass.class, objectEncoder).build(); assertThrows(EncodingException.class, () -> encoder.encode(DummyClass.INSTANCE)); }