### Question:
KdbTree { public static KdbTree buildKdbTree(int maxItemsPerNode, Rectangle extent, List<Rectangle> items) { checkArgument(maxItemsPerNode > 0, "maxItemsPerNode must be > 0"); requireNonNull(extent, "extent is null"); requireNonNull(items, "items is null"); return new KdbTree(buildKdbTreeNode(maxItemsPerNode, 0, extent, items, new LeafIdAllocator())); } @JsonCreator  KdbTree(@JsonProperty("root") Node root); @JsonProperty Node getRoot(); @Override boolean equals(Object obj); @Override int hashCode(); Map<Integer, Rectangle> getLeaves(); Map<Integer, Rectangle> findIntersectingLeaves(Rectangle envelope); static KdbTree buildKdbTree(int maxItemsPerNode, Rectangle extent, List<Rectangle> items);  }### Answer:
@Test public void testSerde() { Rectangle extent = new Rectangle(0, 0, 9, 4); ImmutableList.Builder<Rectangle> rectangles = ImmutableList.builder(); for (double x = 0; x < 10; x += 1) { for (double y = 0; y < 5; y += 1) { rectangles.add(new Rectangle(x, y, x + 0.1, y + 0.2)); } } testSerializationRoundtrip(buildKdbTree(100, extent, rectangles.build())); testSerializationRoundtrip(buildKdbTree(20, extent, rectangles.build())); testSerializationRoundtrip(buildKdbTree(10, extent, rectangles.build())); }