tabPane.getTabs().add(createTab("Pets", createPetNode())); tabPane.getTabs().add(createTab("Invoices", createInvoiceNode())); return tabPane; } private Node createPetNode() { List<Pet> pets = new PetDao().fetchPetsForCustomer(customer.getId()); PetTable table = new PetTable(pets, false) { protected void onDoubleClick(Pet pet) { replace(new PetView(customer, pet)); } }; return table; } 03.10.2017 40 jDD Krakow / Java 9 Refactoring (Rabea Gransberger @rgransberger)