@Test public void same_type_not_included() throws Exception { TestDataType x = new TestDataType("x"); m_dts.add(x); Set<DataType> r = CommonLowerSuperTypes.run(x, x, false); assertEquals(0, r.size()); }
public static Set<DataType> run(DataType t1, DataType t2, boolean include_base) { Ensure.not_null(t1); Ensure.not_null(t2); Set<DataType> super_1 = AllSuperTypes.run(t1, include_base); Set<DataType> super_2 = AllSuperTypes.run(t2, include_base); Set<DataType> common = new HashSet<>(super_1); common.retainAll(super_2); for (DataType t : new HashSet<>(common)) { boolean is_super_of_any = false; for (DataType c : common) { if (t.super_of(c)) { is_super_of_any = true; break; } } if (is_super_of_any) { common.remove(t); } } return common; }
CommonLowerSuperTypes { public static Set<DataType> run(DataType t1, DataType t2, boolean include_base) { Ensure.not_null(t1); Ensure.not_null(t2); Set<DataType> super_1 = AllSuperTypes.run(t1, include_base); Set<DataType> super_2 = AllSuperTypes.run(t2, include_base); Set<DataType> common = new HashSet<>(super_1); common.retainAll(super_2); for (DataType t : new HashSet<>(common)) { boolean is_super_of_any = false; for (DataType c : common) { if (t.super_of(c)) { is_super_of_any = true; break; } } if (is_super_of_any) { common.remove(t); } } return common; } }
CommonLowerSuperTypes { public static Set<DataType> run(DataType t1, DataType t2, boolean include_base) { Ensure.not_null(t1); Ensure.not_null(t2); Set<DataType> super_1 = AllSuperTypes.run(t1, include_base); Set<DataType> super_2 = AllSuperTypes.run(t2, include_base); Set<DataType> common = new HashSet<>(super_1); common.retainAll(super_2); for (DataType t : new HashSet<>(common)) { boolean is_super_of_any = false; for (DataType c : common) { if (t.super_of(c)) { is_super_of_any = true; break; } } if (is_super_of_any) { common.remove(t); } } return common; } private  CommonLowerSuperTypes(); }
CommonLowerSuperTypes { public static Set<DataType> run(DataType t1, DataType t2, boolean include_base) { Ensure.not_null(t1); Ensure.not_null(t2); Set<DataType> super_1 = AllSuperTypes.run(t1, include_base); Set<DataType> super_2 = AllSuperTypes.run(t2, include_base); Set<DataType> common = new HashSet<>(super_1); common.retainAll(super_2); for (DataType t : new HashSet<>(common)) { boolean is_super_of_any = false; for (DataType c : common) { if (t.super_of(c)) { is_super_of_any = true; break; } } if (is_super_of_any) { common.remove(t); } } return common; } private  CommonLowerSuperTypes(); static Set<DataType> run(DataType t1, DataType t2, 
			boolean include_base); }
CommonLowerSuperTypes { public static Set<DataType> run(DataType t1, DataType t2, boolean include_base) { Ensure.not_null(t1); Ensure.not_null(t2); Set<DataType> super_1 = AllSuperTypes.run(t1, include_base); Set<DataType> super_2 = AllSuperTypes.run(t2, include_base); Set<DataType> common = new HashSet<>(super_1); common.retainAll(super_2); for (DataType t : new HashSet<>(common)) { boolean is_super_of_any = false; for (DataType c : common) { if (t.super_of(c)) { is_super_of_any = true; break; } } if (is_super_of_any) { common.remove(t); } } return common; } private  CommonLowerSuperTypes(); static Set<DataType> run(DataType t1, DataType t2, 
			boolean include_base);  }