// Path: src/main/java/pl/maciejwalkowiak/plist/handler/Handler.java
// public interface Handler {
// 	boolean supports(Object object);
// 	String handle(Object object);
// }
// 
// Path: src/main/java/pl/maciejwalkowiak/plist/strategy/UppercaseNamingStrategy.java
// public class UppercaseNamingStrategy implements NamingStrategy {
// 	public String fieldNameToKey(String toConvert) {
// 		return addUnderscores(toConvert).toUpperCase();
// 	}
// 
// 	protected static String addUnderscores(String name) {
// 		StringBuffer buf = new StringBuffer(name.replace('.', '_'));
// 		for (int i = 1; i < buf.length() - 1; i++) {
// 			if (
// 					Character.isLowerCase(buf.charAt(i - 1)) &&
// 							Character.isUpperCase(buf.charAt(i)) &&
// 							Character.isLowerCase(buf.charAt(i + 1))
// 					) {
// 				buf.insert(i++, '_');
// 			}
// 		}
// 		return buf.toString().toLowerCase();
// 	}
// }
// 
// Path: src/main/java/pl/maciejwalkowiak/plist/plisttypes/PlistData.java
// public class PlistData {
// 	private byte[] data;
// 	
// 	public PlistData(byte[] data) {
// 		this.data = data;
// 	}
// 	
// 	public byte[] getData() {
// 		return data;
// 	}
// }


import static org.fest.assertions.Assertions.assertThat;
import org.junit.Test;
import pl.maciejwalkowiak.plist.handler.Handler;
import pl.maciejwalkowiak.plist.strategy.UppercaseNamingStrategy;
import pl.maciejwalkowiak.plist.plisttypes.PlistData;
import java.math.BigDecimal;
import java.util.*;
	@Test
	public void testFieldSerializationWhenNull() {
		//given
		Comment comment = new Comment(null, "content");

		//when
		String xml = plistSerializer.serialize(comment);

		//then
		assertThat(xml).isEqualTo("<dict><key>content</key><string>content</string></dict>");
	}

	@Test
	public void testToXML() {
		//given
		String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\">";
		String footer = "</plist>";

		String testObject= "testObject";

		//when
		String xml = plistSerializer.toXmlPlist(testObject);

		//then
		assertThat(xml).startsWith(header).endsWith(footer);
	}

	@Test
	public void testAdditionalHandler() {
		//given
// Path: src/main/java/pl/maciejwalkowiak/plist/handler/Handler.java
// public interface Handler {
// 	boolean supports(Object object);
// 	String handle(Object object);
// }
// 
// Path: src/main/java/pl/maciejwalkowiak/plist/strategy/UppercaseNamingStrategy.java
// public class UppercaseNamingStrategy implements NamingStrategy {
// 	public String fieldNameToKey(String toConvert) {
// 		return addUnderscores(toConvert).toUpperCase();
// 	}
// 
// 	protected static String addUnderscores(String name) {
// 		StringBuffer buf = new StringBuffer(name.replace('.', '_'));
// 		for (int i = 1; i < buf.length() - 1; i++) {
// 			if (
// 					Character.isLowerCase(buf.charAt(i - 1)) &&
// 							Character.isUpperCase(buf.charAt(i)) &&
// 							Character.isLowerCase(buf.charAt(i + 1))
// 					) {
// 				buf.insert(i++, '_');
// 			}
// 		}
// 		return buf.toString().toLowerCase();
// 	}
// }
// 
// Path: src/main/java/pl/maciejwalkowiak/plist/plisttypes/PlistData.java
// public class PlistData {
// 	private byte[] data;
// 	
// 	public PlistData(byte[] data) {
// 		this.data = data;
// 	}
// 	
// 	public byte[] getData() {
// 		return data;
// 	}
// }


// Path: src/test/java/pl/maciejwalkowiak/plist/PlistSerializerImplTest.java
import static org.fest.assertions.Assertions.assertThat;
import org.junit.Test;
import pl.maciejwalkowiak.plist.handler.Handler;
import pl.maciejwalkowiak.plist.strategy.UppercaseNamingStrategy;
import pl.maciejwalkowiak.plist.plisttypes.PlistData;
import java.math.BigDecimal;
import java.util.*;

	@Test
	public void testFieldSerializationWhenNull() {
		//given
		Comment comment = new Comment(null, "content");

		//when
		String xml = plistSerializer.serialize(comment);

		//then
		assertThat(xml).isEqualTo("<dict><key>content</key><string>content</string></dict>");
	}

	@Test
	public void testToXML() {
		//given
		String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\">";
		String footer = "</plist>";

		String testObject= "testObject";

		//when
		String xml = plistSerializer.toXmlPlist(testObject);

		//then
		assertThat(xml).startsWith(header).endsWith(footer);
	}

	@Test
	public void testAdditionalHandler() {
		//given
		Handler bigDecimalHandler = new BigDecimalHandler();