I'm wondering why I'm getting a NullPointerException. Both solutions work in Eclipse. Thanks in advance! Another solution:
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		HashMap<String, String> map = new HashMap<String, String>();

		while (true) {

			String stadt = reader.readLine();
			String name = reader.readLine();
			if (stadt.isEmpty() && name.isEmpty()) {
				break;
			}

			map.put(stadt, name);
		}

		String stadtt = reader.readLine();

		for (Map.Entry<String, String> entry : map.entrySet()) {
			if (stadtt.equals(entry.getKey())) {
				System.out.println(entry.getValue());
			}
		}