@Test public void testInsertionOrderIsPreserved() { final UUID uuid = UUID.fromString("01234567-0123-4567-89AB-456789ABCDEF"); final Region region = new Region .Builder() .addIntegerField(28536) .addUuidField(uuid) .addIntegerField(100) .addIntegerField(65530) .addByteField((byte) 0xBE) .build(); assertEquals(28536, region.getFieldAt(0)); assertEquals(uuid, region.getFieldAt(1)); assertEquals(100, region.getFieldAt(2)); assertEquals(65530, region.getFieldAt(3)); assertEquals((byte) 0xBE, region.getFieldAt(4)); }
public Object getFieldAt(int i) { if (regionFields.size() > i) { return regionFields.get(i); } else { return null; } }
Region { public Object getFieldAt(int i) { if (regionFields.size() > i) { return regionFields.get(i); } else { return null; } } }
Region { public Object getFieldAt(int i) { if (regionFields.size() > i) { return regionFields.get(i); } else { return null; } } private  Region(@NonNull List<Object> regionFields); }
Region { public Object getFieldAt(int i) { if (regionFields.size() > i) { return regionFields.get(i); } else { return null; } } private  Region(@NonNull List<Object> regionFields); Object getFieldAt(int i); }
Region { public Object getFieldAt(int i) { if (regionFields.size() > i) { return regionFields.get(i); } else { return null; } } private  Region(@NonNull List<Object> regionFields); Object getFieldAt(int i);  }