FeatureSet { public static String getFeatureSetStringRef(FeatureSetSpec featureSetSpec) { return String.format("%s/%s", featureSetSpec.getProject(), featureSetSpec.getName()); }  static String getFeatureSetStringRef(FeatureSetSpec featureSetSpec); static String getFeatureSetStringRef(FeatureSetReference featureSetReference);  }
@Test public void shouldReturnFeatureSetStringRef() { FeatureSetSpec featureSetSpec = FeatureSetSpec.newBuilder() .setProject("project1") .setName("featureSetWithConstraints") .addAllEntities(entitySpecs) .addAllFeatures(featureSpecs) .build(); FeatureSetReferenceProto.FeatureSetReference featureSetReference = FeatureSetReferenceProto.FeatureSetReference.newBuilder() .setName(featureSetSpec.getName()) .setProject(featureSetSpec.getProject()) .build(); String actualFeatureSetStringRef1 = FeatureSet.getFeatureSetStringRef(featureSetSpec); String actualFeatureSetStringRef2 = FeatureSet.getFeatureSetStringRef(featureSetReference); String expectedFeatureSetStringRef = "project1/featureSetWithConstraints"; assertThat(actualFeatureSetStringRef1, equalTo(expectedFeatureSetStringRef)); assertThat(actualFeatureSetStringRef2, equalTo(expectedFeatureSetStringRef)); }