@Test void testTransformPackageEmptyMap() { EntityType entityType = mock(EntityType.class); RelationTransformer.transformPackage(entityType, emptyMap()); verify(entityType, never()).setPackage(any(Package.class)); }
static void transformPackage(EntityType entityType, Map<String, Package> newPackages) { if (newPackages.isEmpty()) { return; } Package entityTypePackage = entityType.getPackage(); if (entityTypePackage != null) { String packageId = entityTypePackage.getId(); if (newPackages.containsKey(packageId)) { entityType.setPackage(newPackages.get(packageId)); } } }
RelationTransformer { static void transformPackage(EntityType entityType, Map<String, Package> newPackages) { if (newPackages.isEmpty()) { return; } Package entityTypePackage = entityType.getPackage(); if (entityTypePackage != null) { String packageId = entityTypePackage.getId(); if (newPackages.containsKey(packageId)) { entityType.setPackage(newPackages.get(packageId)); } } } }
RelationTransformer { static void transformPackage(EntityType entityType, Map<String, Package> newPackages) { if (newPackages.isEmpty()) { return; } Package entityTypePackage = entityType.getPackage(); if (entityTypePackage != null) { String packageId = entityTypePackage.getId(); if (newPackages.containsKey(packageId)) { entityType.setPackage(newPackages.get(packageId)); } } } private  RelationTransformer(); }
RelationTransformer { static void transformPackage(EntityType entityType, Map<String, Package> newPackages) { if (newPackages.isEmpty()) { return; } Package entityTypePackage = entityType.getPackage(); if (entityTypePackage != null) { String packageId = entityTypePackage.getId(); if (newPackages.containsKey(packageId)) { entityType.setPackage(newPackages.get(packageId)); } } } private  RelationTransformer();  }
RelationTransformer { static void transformPackage(EntityType entityType, Map<String, Package> newPackages) { if (newPackages.isEmpty()) { return; } Package entityTypePackage = entityType.getPackage(); if (entityTypePackage != null) { String packageId = entityTypePackage.getId(); if (newPackages.containsKey(packageId)) { entityType.setPackage(newPackages.get(packageId)); } } } private  RelationTransformer();   }