@@ -0,0 +1,3474 @@
+package com.github.nsnjson.encoding.style;%0A%0Aimport com.fasterxml.jackson.databind.*;%0Aimport com.fasterxml.jackson.databind.node.*;%0Aimport com.github.nsnjson.encoding.*;%0Aimport org.junit.Assert;%0A%0Aimport java.util.Optional;%0A%0Aimport static com.github.nsnjson.format.Format.*;%0A%0Apublic class ArrayStyleEncodingTest extends AbstractEncodingTest %7B%0A%0A    @Override%0A    protected JsonNode getNullPresentation() %7B%0A        return new ObjectMapper().createArrayNode();%0A    %7D%0A%0A    @Override%0A    protected JsonNode getNumberPresentation(NumericNode value) %7B%0A        ObjectMapper objectMapper = new ObjectMapper();%0A%0A        ArrayNode presentation = objectMapper.createArrayNode();%0A        presentation.add(TYPE_MARKER_NUMBER);%0A        presentation.add(value);%0A%0A        return presentation;%0A    %7D%0A%0A    @Override%0A    protected JsonNode getStringPresentation(TextNode value) %7B%0A        ObjectMapper objectMapper = new ObjectMapper();%0A%0A        ArrayNode presentation = objectMapper.createArrayNode();%0A        presentation.add(TYPE_MARKER_STRING);%0A        presentation.add(value);%0A%0A        return presentation;%0A    %7D%0A%0A    @Override%0A    protected JsonNode getBooleanPresentation(BooleanNode value) %7B%0A        ObjectMapper objectMapper = new ObjectMapper();%0A%0A        ArrayNode presentation = objectMapper.createArrayNode();%0A        presentation.add(TYPE_MARKER_BOOLEAN);%0A        presentation.add(value.asBoolean() ? BOOLEAN_TRUE : BOOLEAN_FALSE);%0A%0A        return presentation;%0A    %7D%0A%0A    @Override%0A    protected JsonNode getArrayPresentation(ArrayNode array) %7B%0A        ObjectMapper objectMapper = new ObjectMapper();%0A%0A        ArrayNode presentation = objectMapper.createArrayNode();%0A        presentation.add(TYPE_MARKER_ARRAY);%0A%0A        for (int i = 0; i %3C array.size(); i++) %7B%0A            JsonNode item = array.get(i);%0A%0A            Optional%3CJsonNode%3E itemPresentationOption = getPresentation(item);%0A%0A            if (itemPresentationOption.isPresent()) %7B%0A                JsonNode itemPresentation = itemPresentationOption.get();%0A%0A                presentation.add(itemPresentation);%0A            %7D%0A        %7D%0A%0A        return presentation;%0A    %7D%0A%0A    @Override%0A    protected JsonNode getObjectPresentation(ObjectNode object) %7B%0A        ObjectMapper objectMapper = new ObjectMapper();%0A%0A        ArrayNode presentation = objectMapper.createArrayNode();%0A        presentation.add(TYPE_MARKER_OBJECT);%0A%0A        object.fieldNames().forEachRemaining(name -%3E %7B%0A            JsonNode value = object.get(name);%0A%0A            Optional%3CJsonNode%3E valuePresentationOption = getPresentation(value);%0A%0A            if (valuePresentationOption.isPresent()) %7B%0A                JsonNode valuePresentation = valuePresentationOption.get();%0A%0A                ObjectNode fieldPresentation = objectMapper.createObjectNode();%0A                fieldPresentation.put(FIELD_NAME, name);%0A%0A                if (valuePresentation.has(FIELD_TYPE)) %7B%0A                    fieldPresentation.set(FIELD_TYPE, valuePresentation.get(FIELD_TYPE));%0A                %7D%0A%0A                if (valuePresentation.has(FIELD_VALUE)) %7B%0A                    fieldPresentation.set(FIELD_VALUE, valuePresentation.get(FIELD_VALUE));%0A                %7D%0A%0A                presentation.add(fieldPresentation);%0A            %7D%0A        %7D);%0A%0A        return presentation;%0A    %7D%0A%0A    @Override%0A    protected void assertEncoding(JsonNode data, JsonNode presentation) %7B%0A        Assert.assertEquals(presentation, assertAndGetPresentation(Encoder.encodeWithArrayStyle(data)));%0A    %7D%0A%0A%7D

Implement ArrayStyleEncodingTest