public static void main(String[] paramArrayOfString) {
		Policy localPolicy = new Policy();
		Statement localStatement1 = new Statement();
		localStatement1.addAction(PolicyAction.get_bucket_policy)
				.addAction(PolicyAction.put_bucket_policy)
				.addAction(PolicyAction.all);
		localStatement1.addResource("/1").addResource("/2").addResource("/3");
		localStatement1.addUser("user1").addUser("user2");
		localStatement1.setEffect(PolicyEffect.allow);
		PolicyTime localPolicyTime = new PolicyTime();
		localPolicyTime
				.addSingleTime("2012-01-04D12:12:1")
				.addSingleTime("2012-01-04D12:12:2")
				.addTimeRange(new Pair("2012-01-04D12:12:3", "2012-01-04D12:12:4"));

		localStatement1.setTime(localPolicyTime);
		PolicyIP localPolicyIP = new PolicyIP();
		localPolicyIP.addSingleIp("1.1.1.1").addCidrIp("2.2.2.2/16").addIpRange(new Pair("3.3.3.3", "4.4.4.4"));
		localStatement1.setIp(localPolicyIP);

		Statement localStatement2 = new Statement();
		localStatement2.addAction(PolicyAction.get_bucket_policy).addAction(
				PolicyAction.put_bucket_policy);
		localStatement2.addResource("/1").addResource("/2").addResource("/3");
		localStatement2.addUser("user1").addUser("user2");
		localStatement2.setEffect(PolicyEffect.deny);

		localPolicy.addStatements(localStatement1);
		localPolicy.addStatements(localStatement2);

		String str1 = localPolicy.toJson();
		log.info("Policy object to json str:\n" + str1);

		localPolicy = new Policy().buildJsonStr(str1);

		String str2 = localPolicy.toJson();
		log.info("Json str 2 policy object 2 json str:\n" + str2);

		if (str1.equals(str2))
			log.info("Correct");
		else
			log.info("Invalid");
	}