### Question:
StageUtils { public static String jaxbToString(Object jaxbObj) throws JAXBException, JsonGenerationException, JsonMappingException, IOException { return getGson().toJson(jaxbObj); } @Inject  StageUtils(StageFactory stageFactory); static Gson getGson(); static void setGson(Gson gson); static void setTopologyManager(TopologyManager topologyManager); static void setConfiguration(Configuration configuration); static String getActionId(long requestId, long stageId); static long[] getRequestStage(String actionId); static Stage getATestStage(long requestId, long stageId, String commandParamsStage, String hostParamsStage); @Inject static Stage getATestStage(long requestId, long stageId, String hostname, String commandParamsStage, String hostParamsStage); static String jaxbToString(Object jaxbObj); static T fromJson(String json, Class<T> clazz); static Map<String, String> getCommandParamsStage(ActionExecutionContext actionExecContext, String requestContext); static String getClusterHostInfoKey(String componentName); static Map<String, Set<String>> getClusterHostInfo(Cluster cluster); static Map<String, Set<String>> substituteHostIndexes(Map<String, Set<String>> clusterHostInfo); static Set<String> replaceRanges(SortedSet<Integer> set); static Set<String> replaceMappedRanges(List<T> values); static String getHostName(); static void useAmbariJdkInCommandParams(Map<String, String> commandParams, Configuration configuration); static void useStackJdkIfExists(Map<String, String> hostLevelParams, Configuration configuration); static final Integer DEFAULT_PING_PORT; static final String DEFAULT_RACK; static final String DEFAULT_IPV4_ADDRESS; }### Answer:
@Test public void testJaxbToString() throws Exception { StageUtils stageUtils = new StageUtils(injector.getInstance(StageFactory.class)); Stage s = StageUtils.getATestStage(1, 2, "host1", "", "hostParamsStage"); String hostname = s.getHosts().get(0); List<ExecutionCommandWrapper> wrappers = s.getExecutionCommands(hostname); for (ExecutionCommandWrapper wrapper : wrappers) { } assertEquals(StageUtils.getActionId(1, 2), s.getActionId()); }