protected List<BadgerEntity<CountryExtended>> getTestCountryExtendedsForCreate( List<String> currencyIds) { List<BadgerEntity<CountryExtended>> builder = new ArrayList<>(); for (int i = 0; i < NUM_COUNTRY_EXTENDEDS; i++) { builder.add( getBadgerCore() .getBadgerEntity( CountryExtended.newBuilder() .setName("United States" + i) .setAlpha2Code(ALL_STRINGS_2_LIST.get(i)) .setAlpha3Code(ALL_STRINGS_3_LIST.get(i)) .setNumericCode(i) .setCurrencyId(currencyIds.get(i % currencyIds.size())) .addRepeatedString11("a" + i) .addRepeatedString11("b" + i) .addRepeatedUint6412(i) .addRepeatedUint6412(i + 1) .setI(i) .setFoo15(Foo.valueOf((i % Foo.values().length) + 1)) .addRepeatedFoo16(Foo.valueOf((i % Foo.values().length) + 1)) .addRepeatedFoo16(Foo.valueOf(((i + 1) % Foo.values().length) + 1)) .setNested17( Nested.newBuilder() .setString1("aa" + i) .setUint642(i) .addRepeatedString3("aa" + i) .addRepeatedString3("ab" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .setNestedNested5( NestedNested.newBuilder() .setString1("aaa" + i) .setUint642(i) .addRepeatedString3("aaa" + i) .addRepeatedString3("aba" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("aba" + i) .setUint642(i) .addRepeatedString3("aba" + i) .addRepeatedString3("abb" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("ac" + i) .setUint642(i) .addRepeatedString3("ac" + i) .addRepeatedString3("bc" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build())) .addRepeatedNested18( Nested.newBuilder() .setString1("1aa" + i) .setUint642(i) .addRepeatedString3("1aa" + i) .addRepeatedString3("1ab" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .setNestedNested5( NestedNested.newBuilder() .setString1("1aaa" + i) .setUint642(i) .addRepeatedString3("1aaa" + i) .addRepeatedString3("1aba" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("1aba" + i) .setUint642(i) .addRepeatedString3("1aba" + i) .addRepeatedString3("1abb" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("1ac" + i) .setUint642(i) .addRepeatedString3("1ac" + i) .addRepeatedString3("1bc" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build())) .addRepeatedNested18( Nested.newBuilder() .setString1("2aa" + i) .setUint642(i) .addRepeatedString3("2aa" + i) .addRepeatedString3("2ab" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .setNestedNested5( NestedNested.newBuilder() .setString1("2aaa" + i) .setUint642(i) .addRepeatedString3("2aaa" + i) .addRepeatedString3("2aba" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("2aba" + i) .setUint642(i) .addRepeatedString3("2aba" + i) .addRepeatedString3("2abb" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build()) .addRepeatedNestedNested6( NestedNested.newBuilder() .setString1("2ac" + i) .setUint642(i) .addRepeatedString3("2ac" + i) .addRepeatedString3("2bc" + i) .addRepeatedUint644(i) .addRepeatedUint644(i + 1) .build())) .build())); } return builder; }
protected void assertNested( int i, Nested nested, String string1, String repeatedString3one, String repeatedString3two, String nestedNested5String1, String nestedNested5RepeatedString3One, String nestedNested5RepeatedString3two, String repeatedNestedNested6oneString1, String repeatedNestedNested6oneRepeatedString3one, String repeatedNestedNestedone6RepeatedString3two, String repeatedNestedNested6twoString1, String repeatedNestedNested6twoRepeatedString3one, String repeatedNestedNestedtwo6RepeatedString3two) { assertEquals(string1 + i, nested.getString1()); assertEquals(i, nested.getUint642()); assertArrayEquals( new String[] {repeatedString3one + i, repeatedString3two + i}, nested.getRepeatedString3List().toArray(new String[0])); assertArrayEquals( new Long[] {Long.valueOf(i), Long.valueOf(i + 1)}, nested.getRepeatedUint644List().toArray(new Long[0])); NestedNested nestedNested = nested.getNestedNested5(); assertEquals(nestedNested5String1 + i, nestedNested.getString1()); assertEquals(i, nestedNested.getUint642()); assertArrayEquals( new String[] {nestedNested5RepeatedString3One + i, nestedNested5RepeatedString3two + i}, nestedNested.getRepeatedString3List().toArray(new String[0])); assertArrayEquals( new Long[] {Long.valueOf(i), Long.valueOf(i + 1)}, nestedNested.getRepeatedUint644List().toArray(new Long[0])); assertEquals(2, nested.getRepeatedNestedNested6Count()); NestedNested nestedNestedOne = nested.getRepeatedNestedNested6(0); assertEquals(repeatedNestedNested6oneString1 + i, nestedNestedOne.getString1()); assertEquals(i, nestedNestedOne.getUint642()); assertArrayEquals( new String[] { repeatedNestedNested6oneRepeatedString3one + i, repeatedNestedNestedone6RepeatedString3two + i }, nestedNestedOne.getRepeatedString3List().toArray(new String[0])); assertArrayEquals( new Long[] {Long.valueOf(i), Long.valueOf(i + 1)}, nestedNestedOne.getRepeatedUint644List().toArray(new Long[0])); NestedNested nestedNestedTwo = nested.getRepeatedNestedNested6(1); assertEquals(repeatedNestedNested6twoString1 + i, nestedNestedTwo.getString1()); assertEquals(i, nestedNestedTwo.getUint642()); assertArrayEquals( new String[] { repeatedNestedNested6twoRepeatedString3one + i, repeatedNestedNestedtwo6RepeatedString3two + i }, nestedNestedTwo.getRepeatedString3List().toArray(new String[0])); assertArrayEquals( new Long[] {Long.valueOf(i), Long.valueOf(i + 1)}, nestedNestedTwo.getRepeatedUint644List().toArray(new Long[0])); }