@Test public void testEqualsAddrEpLocByAddrEpKey() { Map<AddressEndpointKey, AddressEndpointLocation> o1 = new HashMap<>(); Map<AddressEndpointKey, AddressEndpointLocation> o1_equal = new HashMap<>(); AddressEndpoint ep1_1 = new AddressEndpointBuilder().setContextType(ContextType.class) .setContextId(new ContextId("ctx1")) .setAddressType(AddressType.class) .setAddress("adr1_1") .build(); AddressEndpointLocation loc1_1 = new AddressEndpointLocationBuilder().setContextType(ep1_1.getContextType()) .setContextId(ep1_1.getContextId()) .setAddressType(ep1_1.getAddressType()) .setAddress(ep1_1.getAddress()) .build(); o1.put(ep1_1.getKey(), loc1_1); o1_equal.put(ep1_1.getKey(), loc1_1); Map<AddressEndpointKey, AddressEndpointLocation> o2 = new HashMap<>(); AddressEndpoint ep2_1 = new AddressEndpointBuilder().setContextType(ContextType.class) .setContextId(new ContextId("ctx2")) .setAddressType(AddressType.class) .setAddress("adr2_1") .build(); AddressEndpointLocation loc2_1 = new AddressEndpointLocationBuilder().setContextType(ep2_1.getContextType()) .setContextId(ep2_1.getContextId()) .setAddressType(ep2_1.getAddressType()) .setAddress(ep2_1.getAddress()) .build(); AddressEndpoint ep2_2 = new AddressEndpointBuilder().setContextType(ContextType.class) .setContextId(new ContextId("ctx2")) .setAddressType(AddressType.class) .setAddress("adr2_2") .build(); AddressEndpointLocation loc2_2 = new AddressEndpointLocationBuilder().setContextType(ep2_2.getContextType()) .setContextId(ep2_2.getContextId()) .setAddressType(ep2_2.getAddressType()) .setAddress(ep2_2.getAddress()) .build(); o2.put(ep2_1.getKey(), loc2_1); o2.put(ep2_2.getKey(), loc2_2); Map<AddressEndpointKey, AddressEndpointLocation> o3 = new HashMap<>(); AddressEndpoint ep3_1 = new AddressEndpointBuilder().setContextType(ContextType.class) .setContextId(new ContextId("ctx3")) .setAddressType(AddressType.class) .setAddress("adr3_1") .build(); AddressEndpointLocation loc3_1 = new AddressEndpointLocationBuilder().setContextType(ep3_1.getContextType()) .setContextId(ep3_1.getContextId()) .setAddressType(ep3_1.getAddressType()) .setAddress(ep3_1.getAddress()) .build(); o3.put(ep3_1.getKey(), loc3_1); assertFalse(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(null, o2)); assertFalse(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(o1, null)); assertTrue(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(null, null)); assertTrue(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(o1, o1)); assertTrue(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(o1, o1_equal)); assertFalse(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(o1, o2)); assertFalse(DtoEquivalenceUtils.equalsAddrEpLocByAddrEpKey(o1, o3)); }
static boolean equalsAddrEpLocByAddrEpKey(Map<AddressEndpointKey, AddressEndpointLocation> o1, Map<AddressEndpointKey, AddressEndpointLocation> o2) { return equalsDtoMapsByEquivalence(o1, o2, ADDR_EP_LOC_EQ); }
DtoEquivalenceUtils { static boolean equalsAddrEpLocByAddrEpKey(Map<AddressEndpointKey, AddressEndpointLocation> o1, Map<AddressEndpointKey, AddressEndpointLocation> o2) { return equalsDtoMapsByEquivalence(o1, o2, ADDR_EP_LOC_EQ); } }
DtoEquivalenceUtils { static boolean equalsAddrEpLocByAddrEpKey(Map<AddressEndpointKey, AddressEndpointLocation> o1, Map<AddressEndpointKey, AddressEndpointLocation> o2) { return equalsDtoMapsByEquivalence(o1, o2, ADDR_EP_LOC_EQ); } private  DtoEquivalenceUtils(); }
DtoEquivalenceUtils { static boolean equalsAddrEpLocByAddrEpKey(Map<AddressEndpointKey, AddressEndpointLocation> o1, Map<AddressEndpointKey, AddressEndpointLocation> o2) { return equalsDtoMapsByEquivalence(o1, o2, ADDR_EP_LOC_EQ); } private  DtoEquivalenceUtils();  }
DtoEquivalenceUtils { static boolean equalsAddrEpLocByAddrEpKey(Map<AddressEndpointKey, AddressEndpointLocation> o1, Map<AddressEndpointKey, AddressEndpointLocation> o2) { return equalsDtoMapsByEquivalence(o1, o2, ADDR_EP_LOC_EQ); } private  DtoEquivalenceUtils();   }