NestedField implements IField { @Override public <T> T in(final IObject env, final Class type) throws ReadValueException, InvalidArgumentException { return field.in(getFinalObjectRead(env), type); } NestedField(final String fieldName); @Override void out(final IObject env, final T in); @Override T in(final IObject env, final Class type); @Override T in(final IObject env);  }
@Test public void Should_ReturnNestedFieldValue() throws Exception { IObject object = new DSObject("{\"fieldA\":{\"fieldB\":\"I am nested field\"}}"); NestedField nestedField = new NestedField("fieldA/fieldB"); assertEquals(nestedField.in(object, String.class), "I am nested field"); }