Here you can find the source of differentCategory(String prop1, String prop2, List
public static boolean differentCategory(String prop1, String prop2, List<String> cat1, List<String> cat2)
//package com.java2s; import java.util.List; public class Main { /**//from www . ja v a2 s. co m * checks if one property belongs to some category and the other to different category */ public static boolean differentCategory(String prop1, String prop2, List<String> cat1, List<String> cat2) { return !(cat1 == null || cat2 == null || cat1.isEmpty() || cat2.isEmpty()) && ((cat1.contains(prop1) && cat2.contains(prop2)) || (cat1.contains(prop2) && cat2.contains(prop1))); } }