### Question:
StructureImpl implements Structure { void addDeclaration(final StringBuilder builder, final int level) { for (final Field field : getFields()) { builder.append(StringUtils.repeat(" ", level * 2)); builder.append(level).append(" "); builder.append(field.getDeclaration()); builder.append("\n"); if (field.getType().isComplexType()) { ((StructureImpl) field.getStructure()).addDeclaration(builder, level + 1); } } } StructureImpl(final Map<String, Field> fields); @Override Field getField(final String fieldName); @Override List<Field> getFields(); @Override DataType getType(final String fieldName); @Override boolean hasMember(final String fieldName);  }### Answer:
@Test public void testAddDeclaration() { final StringBuilder builder = new StringBuilder(); structure.addDeclaration(builder, 1); final String declaration = builder.toString(); assertThat(declaration).isEqualTo(" 1 " + FIELD.getDeclaration() + "\n"); }