Name.Builder nameBuilder = Complex.Name.newBuilder();
nameBuilder.setFloatVal(5f).setIntVal(100).setLongVal(5000l);
nameBuilder.addAllStringVal(Arrays.asList("All", "you", "need", "is", "money"));
nameBuilder.setRepeatedLong(RepeatedLongs.newBuilder().addAllLongVal(LIST_OF_LONGS));
Name name = nameBuilder.build();
Link link1 = Link.newBuilder().addLanguage("CZ").addLanguage("EN-US").setUrl("http://google.com").build();
Link link2 = Link.newBuilder().addLanguage("RU").setUrl("https://vk.com/").build();
Complex.Builder complexBuilder = Complex.newBuilder();
complexBuilder.setDocId(5);
complexBuilder.setName(name);
complexBuilder.addLink(link1);
complexBuilder.addLink(link2);
complexBuilder.setType(Type.UPDATE);
complex = complexBuilder.build();
nameBytes = name.toByteArray();
link1Bytes = link1.toByteArray();
link2Bytes = link2.toByteArray();
}