EntryPointParser { public String serializeEntry(List<String> entry) { try { return mapper.writer().writeValueAsString(entry); } catch (JsonProcessingException e) { throw new IllegalStateException( format("Failed to serialize list of strings %s to YAML", entry), e); } }  EntryPoint parse(Map<String, String> machineAttributes); String serializeEntry(List<String> entry);  }
@Test public void shouldSerializeValidData() { List<String> data = asList("/bin/sh", "-c"); EntryPointParser parser = new EntryPointParser(); String serialized = parser.serializeEntry(data); assertEquals(serialized, "---\n- \"/bin/sh\"\n- \"-c\"\n"); }