// Path: google-cloud-core/src/main/java/com/google/cloud/Policy.java
// public static class DefaultMarshaller extends Marshaller<com.google.iam.v1.Policy> {
// 
//   @Override
//   protected Policy fromPb(com.google.iam.v1.Policy policyPb) {
//     ImmutableList.Builder<Binding> bindingsListBuilder = ImmutableList.builder();
//     for (com.google.iam.v1.Binding bindingPb : policyPb.getBindingsList()) {
//       Binding.Builder convertedBinding =
//           Binding.newBuilder()
//               .setRole(bindingPb.getRole())
//               .setMembers(bindingPb.getMembersList());
//       if (bindingPb.hasCondition()) {
//         Expr expr = bindingPb.getCondition();
//         convertedBinding.setCondition(
//             Condition.newBuilder()
//                 .setTitle(expr.getTitle())
//                 .setDescription(expr.getDescription())
//                 .setExpression(expr.getExpression())
//                 .build());
//       }
//       bindingsListBuilder.add(convertedBinding.build());
//     }
//     return newBuilder()
//         .setBindings(bindingsListBuilder.build())
//         .setEtag(
//             policyPb.getEtag().isEmpty()
//                 ? null
//                 : BaseEncoding.base64().encode(policyPb.getEtag().toByteArray()))
//         .setVersion(policyPb.getVersion())
//         .build();
//   }
// 
//   @Override
//   protected com.google.iam.v1.Policy toPb(Policy policy) {
//     com.google.iam.v1.Policy.Builder policyBuilder = com.google.iam.v1.Policy.newBuilder();
//     List<com.google.iam.v1.Binding> bindingPbList = new LinkedList<>();
//     for (Binding binding : policy.getBindingsList()) {
//       com.google.iam.v1.Binding.Builder bindingBuilder = com.google.iam.v1.Binding.newBuilder();
//       bindingBuilder.setRole(binding.getRole());
//       bindingBuilder.addAllMembers(binding.getMembers());
//       if (binding.getCondition() != null) {
//         Condition condition = binding.getCondition();
//         bindingBuilder.setCondition(
//             Expr.newBuilder()
//                 .setTitle(condition.getTitle())
//                 .setDescription(condition.getDescription())
//                 .setExpression(condition.getExpression())
//                 .build());
//       }
//       bindingPbList.add(bindingBuilder.build());
//     }
//     policyBuilder.addAllBindings(bindingPbList);
//     if (policy.etag != null) {
//       policyBuilder.setEtag(ByteString.copyFrom(BaseEncoding.base64().decode(policy.etag)));
//     }
//     policyBuilder.setVersion(policy.version);
//     return policyBuilder.build();
//   }
// }


import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.cloud.Policy.DefaultMarshaller;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
    Policy anotherPolicy = Policy.newBuilder().build();
    assertEquals(emptyPolicy, anotherPolicy);
    assertEquals(emptyPolicy.hashCode(), anotherPolicy.hashCode());
    assertNotEquals(FULL_POLICY, SIMPLE_POLICY);
    assertNotEquals(FULL_POLICY.hashCode(), SIMPLE_POLICY.hashCode());
    Policy copy = SIMPLE_POLICY.toBuilder().build();
    assertEquals(SIMPLE_POLICY, copy);
    assertEquals(SIMPLE_POLICY.hashCode(), copy.hashCode());
  }

  @Test
  public void testBindings() {
    assertTrue(Policy.newBuilder().build().getBindings().isEmpty());
    assertEquals(BINDINGS, SIMPLE_POLICY.getBindings());
  }

  @Test
  public void testEtag() {
    assertNull(SIMPLE_POLICY.getEtag());
    assertEquals("etag", FULL_POLICY.getEtag());
  }

  @Test
  public void testVersion() {
    assertEquals(0, SIMPLE_POLICY.getVersion());
    assertEquals(1, FULL_POLICY.getVersion());
  }

  @Test
  public void testDefaultMarshaller() {
// Path: google-cloud-core/src/main/java/com/google/cloud/Policy.java
// public static class DefaultMarshaller extends Marshaller<com.google.iam.v1.Policy> {
// 
//   @Override
//   protected Policy fromPb(com.google.iam.v1.Policy policyPb) {
//     ImmutableList.Builder<Binding> bindingsListBuilder = ImmutableList.builder();
//     for (com.google.iam.v1.Binding bindingPb : policyPb.getBindingsList()) {
//       Binding.Builder convertedBinding =
//           Binding.newBuilder()
//               .setRole(bindingPb.getRole())
//               .setMembers(bindingPb.getMembersList());
//       if (bindingPb.hasCondition()) {
//         Expr expr = bindingPb.getCondition();
//         convertedBinding.setCondition(
//             Condition.newBuilder()
//                 .setTitle(expr.getTitle())
//                 .setDescription(expr.getDescription())
//                 .setExpression(expr.getExpression())
//                 .build());
//       }
//       bindingsListBuilder.add(convertedBinding.build());
//     }
//     return newBuilder()
//         .setBindings(bindingsListBuilder.build())
//         .setEtag(
//             policyPb.getEtag().isEmpty()
//                 ? null
//                 : BaseEncoding.base64().encode(policyPb.getEtag().toByteArray()))
//         .setVersion(policyPb.getVersion())
//         .build();
//   }
// 
//   @Override
//   protected com.google.iam.v1.Policy toPb(Policy policy) {
//     com.google.iam.v1.Policy.Builder policyBuilder = com.google.iam.v1.Policy.newBuilder();
//     List<com.google.iam.v1.Binding> bindingPbList = new LinkedList<>();
//     for (Binding binding : policy.getBindingsList()) {
//       com.google.iam.v1.Binding.Builder bindingBuilder = com.google.iam.v1.Binding.newBuilder();
//       bindingBuilder.setRole(binding.getRole());
//       bindingBuilder.addAllMembers(binding.getMembers());
//       if (binding.getCondition() != null) {
//         Condition condition = binding.getCondition();
//         bindingBuilder.setCondition(
//             Expr.newBuilder()
//                 .setTitle(condition.getTitle())
//                 .setDescription(condition.getDescription())
//                 .setExpression(condition.getExpression())
//                 .build());
//       }
//       bindingPbList.add(bindingBuilder.build());
//     }
//     policyBuilder.addAllBindings(bindingPbList);
//     if (policy.etag != null) {
//       policyBuilder.setEtag(ByteString.copyFrom(BaseEncoding.base64().decode(policy.etag)));
//     }
//     policyBuilder.setVersion(policy.version);
//     return policyBuilder.build();
//   }
// }


// Path: google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.cloud.Policy.DefaultMarshaller;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

    Policy anotherPolicy = Policy.newBuilder().build();
    assertEquals(emptyPolicy, anotherPolicy);
    assertEquals(emptyPolicy.hashCode(), anotherPolicy.hashCode());
    assertNotEquals(FULL_POLICY, SIMPLE_POLICY);
    assertNotEquals(FULL_POLICY.hashCode(), SIMPLE_POLICY.hashCode());
    Policy copy = SIMPLE_POLICY.toBuilder().build();
    assertEquals(SIMPLE_POLICY, copy);
    assertEquals(SIMPLE_POLICY.hashCode(), copy.hashCode());
  }

  @Test
  public void testBindings() {
    assertTrue(Policy.newBuilder().build().getBindings().isEmpty());
    assertEquals(BINDINGS, SIMPLE_POLICY.getBindings());
  }

  @Test
  public void testEtag() {
    assertNull(SIMPLE_POLICY.getEtag());
    assertEquals("etag", FULL_POLICY.getEtag());
  }

  @Test
  public void testVersion() {
    assertEquals(0, SIMPLE_POLICY.getVersion());
    assertEquals(1, FULL_POLICY.getVersion());
  }

  @Test
  public void testDefaultMarshaller() {
    DefaultMarshaller marshaller = new DefaultMarshaller();