Here you can find the source of getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo)
public static Map<String, String> getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo)
//package com.java2s; /*//from w w w. ja v a 2 s . co m * Inspired by the Commons Collections package created by Apache * http://commons.apache.org/collections/ * http://www.apache.org/licenses/LICENSE-2.0 */ import java.util.*; public class Main { public static Map<String, String> getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo) { Map<String, String> intersection = new HashMap<String, String>(); for (String key : propertyFileOne.stringPropertyNames()) { String propertyOneValue = propertyFileOne.getProperty(key); String propertyTwoValue = propertyFileTwo.getProperty(key); if (propertyOneValue != null && propertyTwoValue != null && propertyOneValue.equals(propertyTwoValue)) { intersection.put(key, propertyOneValue); } } return intersection; } }