package Klausur;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Ort {

	int x;
	String name;
	String postleitzahl;
	int einwohnerzahl;

	public Ort(int x) {
		this.x = x;

	}

	@Override
	public String toString() {
		return "Ort [x=" + x + "]";
	}
	
	

	public int getX() {
		return x;
	}
	

	public static void main(String[] args) {
	ArrayList<Ort> arr = new ArrayList<>();
	
	arr.add(new Ort(2));
	arr.add(new Ort(4));
	
	arr.stream()
	.filter(p -> p.getX() < 2)
	.mapToInt(p -> p.getX() * 12)
	.sum();
	
		
	}
	
	public static int xy(int n) {
		
		if (n < 0)
			return 0;
		
		else if ( n == 0 || n == 1)
			return 1;
		else
			return n* xy(n-1);
	}
}




