/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package rulespecs2; import java.util.ArrayList; import java.util.List; /** * * @author denis */ public class RulesPECS2 { /** * @param args the command line arguments */ public static void main(String[] args) { RulesPECS2 pecs = new RulesPECS2(); List countrys = new ArrayList<>(); pecs.consumerCity(countrys); pecs.consumerStreet(countrys); pecs.consumerDistrict(countrys); countrys.forEach(System.out::println); } public void producer(List list){ } public void consumerStreet(List list){ list.add(new Street("Ленинский пр.", "Кировский", "Санкт-Петербург", "Россия")); list.add(new Street("Московский пр.", "Московский", "Санкт-Петербург", "Россия")); list.add(new Street("Стачек пр.", "Кировский", "Санкт-Петербург", "Россия")); } public void consumerDistrict(List list){ list.add(new District("Невский", "Санкт-Петербург", "Россия")); } public void consumerCity(List list){ list.add(new City("Санкт-Петербург", "Россия")); } public void method(List list){ } }