public static PTransformMatcher createViewWithViewFn(final Class<? extends ViewFn> viewFnType) {
    return application -> {
      if (!(application.getTransform() instanceof CreatePCollectionView)) {
        return false;
      }
      CreatePCollectionView<?, ?> createView =
          (CreatePCollectionView<?, ?>) application.getTransform();
      ViewFn<?, ?> viewFn = createView.getView().getViewFn();
      return viewFn.getClass().equals(viewFnType);
    };
  }
@Test
  public void createViewWithViewFn() {
    PCollection<Integer> input = p.apply(Create.of(1));
    PCollectionView<Iterable<Integer>> view = input.apply(View.asIterable());
    ViewFn<?, ?> viewFn = view.getViewFn();
    CreatePCollectionView<?, ?> createView = CreatePCollectionView.of(view);

    PTransformMatcher matcher = PTransformMatchers.createViewWithViewFn(viewFn.getClass());
    assertThat(matcher.matches(getAppliedTransform(createView)), is(true));
  }