### Question:
AppPMMLUtils { public static PMML readPMMLFromUpdateKeyMessage(String key, String message, Configuration hadoopConf) throws IOException { String pmmlString; switch (key) { case "MODEL": pmmlString = message; break; case "MODEL-REF": if (hadoopConf == null) { hadoopConf = new Configuration(); } Path messagePath = new Path(message); FileSystem fs = FileSystem.get(messagePath.toUri(), hadoopConf); try (InputStreamReader in = new InputStreamReader(fs.open(messagePath), StandardCharsets.UTF_8)) { pmmlString = CharStreams.toString(in); } catch (FileNotFoundException fnfe) { log.warn("Unable to load model file at {}; ignoring", messagePath); return null; } break; default: throw new IllegalArgumentException("Unknown key " + key); } return PMMLUtils.fromString(pmmlString); } private  AppPMMLUtils(); static String getExtensionValue(PMML pmml, String name); static List<String> getExtensionContent(PMML pmml, String name); static void addExtension(PMML pmml, String key, Object value); static void addExtensionContent(PMML pmml, String key, Collection<?> content); static Array toArray(double... values); static MiningSchema buildMiningSchema(InputSchema schema); static MiningSchema buildMiningSchema(InputSchema schema, double[] importances); static List<String> getFeatureNames(MiningSchema miningSchema); static Integer findTargetIndex(MiningSchema miningSchema); static DataDictionary buildDataDictionary(
      InputSchema schema,
      CategoricalValueEncodings categoricalValueEncodings); static List<String> getFeatureNames(DataDictionary dictionary); static CategoricalValueEncodings buildCategoricalValueEncodings(
      DataDictionary dictionary); static PMML readPMMLFromUpdateKeyMessage(String key,
                                                  String message,
                                                  Configuration hadoopConf);  }### Answer:
@Test public void testReadPMMLFromMessage() throws Exception { PMML pmml = PMMLUtils.buildSkeletonPMML(); String pmmlString = PMMLUtils.toString(pmml); assertEquals(PMMLUtils.VERSION, AppPMMLUtils.readPMMLFromUpdateKeyMessage( "MODEL", pmmlString, null).getVersion()); Path pmmlPath = getTempDir().resolve("out.pmml"); Files.write(pmmlPath, Collections.singleton(pmmlString)); assertEquals(PMMLUtils.VERSION, AppPMMLUtils.readPMMLFromUpdateKeyMessage( "MODEL-REF", pmmlPath.toAbsolutePath().toString(), null).getVersion()); assertNull(AppPMMLUtils.readPMMLFromUpdateKeyMessage("MODEL-REF", "no-such-path", null)); }