public Type type() {
        return pir != null ? Type.trTCM :
                ebs != null ? Type.srTCM : Type.sr2CM;
    }
@Test
    public void testType() {
        BandwidthProfile.Builder bwProfileBuilder = BandwidthProfile.builder()
                .name("profile")
                .cir(Bandwidth.bps(ONE_M))
                .cbs((int) ONE_K)
                .greenAction(getBuilder(Action.PASS).build())
                .redAction(getBuilder(Action.DISCARD).build())
                .colorAware(false);
        assertEquals("wrong bw profile type",
                     bwProfileBuilder.build().type(),
                     BandwidthProfile.Type.sr2CM);

        bwProfileBuilder.ebs((int) TWO_K)
                .yellowAction(getBuilder(Action.REMARK)
                                      .dscpClass(DscpClass.AF11)
                                      .build());
        assertEquals("wrong bw profile type",
                     bwProfileBuilder.build().type(),
                     BandwidthProfile.Type.srTCM);
        bwProfileBuilder.ebs(null);

        bwProfileBuilder.pir(Bandwidth.bps(TEN_M))
                .pbs((int) TWO_K);
        assertEquals("wrong bw profile type",
                     bwProfileBuilder.build().type(),
                     BandwidthProfile.Type.trTCM);
    }