### Question:
TriggerCodec extends ProtoTriggerCodec { public TriggerCodec() { super(TYPE_TO_INTERNAL_TRIGGER); } TriggerCodec();   }### Answer:
@Test public void testTriggerCodec() { ProtoTrigger.PartitionTrigger protoPartition = new ProtoTrigger.PartitionTrigger(new DatasetId("test", "myds"), 4); PartitionTrigger partitionTrigger = new PartitionTrigger(new DatasetId("test", "myds"), 4); testSerDeserYieldsTrigger(protoPartition, partitionTrigger); ProtoTrigger.TimeTrigger protoTime = new ProtoTrigger.TimeTrigger("* * * * *"); TimeTrigger timeTrigger = new TimeTrigger("* * * * *"); testSerDeserYieldsTrigger(protoTime, timeTrigger); ProtoTrigger.ProgramStatusTrigger protoProgramStatus = new ProtoTrigger.ProgramStatusTrigger(new ProgramId("test", "myapp", ProgramType.SERVICE, "myprog"), ImmutableSet.of(ProgramStatus.COMPLETED)); ProgramStatusTrigger programStatusTrigger = new ProgramStatusTrigger(new ProgramId("test", "myapp", ProgramType.SERVICE, "myprog"), ImmutableSet.of(ProgramStatus.COMPLETED)); testSerDeserYieldsTrigger(protoProgramStatus, programStatusTrigger); ProtoTrigger.OrTrigger protoOr = ProtoTrigger.or(protoPartition, ProtoTrigger.and(protoTime, protoProgramStatus)); OrTrigger orTrigger = new OrTrigger(partitionTrigger, new AndTrigger(timeTrigger, programStatusTrigger)); testSerDeserYieldsTrigger(protoOr, orTrigger); ProtoTrigger.AndTrigger protoAnd = ProtoTrigger.and(protoOr, protoTime, ProtoTrigger.or(protoPartition, protoProgramStatus)); AndTrigger andTrigger = new AndTrigger(orTrigger, timeTrigger, new OrTrigger(partitionTrigger, programStatusTrigger)); testSerDeserYieldsTrigger(protoAnd, andTrigger); }