RunConfigUtil { public static ObjectMeta getObjectMetadataFromRunConfig(RunConfig generatorRunConfig) { ObjectMetaBuilder objectMetaBuilder = new ObjectMetaBuilder(); if (generatorRunConfig.getName() != null) { objectMetaBuilder.withName(generatorRunConfig.getName()); objectMetaBuilder.addToLabels("run", generatorRunConfig.getName()); } if (generatorRunConfig.getLabels() != null) { objectMetaBuilder.addToLabels(generatorRunConfig.getLabels()); } return objectMetaBuilder.build(); } private  RunConfigUtil(); static ObjectMeta getObjectMetadataFromRunConfig(RunConfig generatorRunConfig); static PodSpec getPodSpecFromRunConfig(RunConfig generatorRunConfig);  }
@Test void testGetObjectMetadataFromRunConfig() { RunConfig config = new RunConfigBuilder() .withName("test") .withLabels(Collections.singletonMap("foo", "bar")) .build(); ObjectMeta objectMeta = RunConfigUtil.getObjectMetadataFromRunConfig(config); assertNotNull(objectMeta); assertEquals("test", objectMeta.getName()); assertFalse(objectMeta.getLabels().isEmpty()); assertEquals("bar", objectMeta.getLabels().get("foo")); }