boolean hasProjectionMaskApi(JClass definedClass, ClassTemplateSpec templateSpec)
  {
    return _hasProjectionMaskCache.computeIfAbsent(definedClass, (jClass) ->
    {
      try
      {
        final Class<?> clazz = _classLoader.loadClass(jClass.fullName());
        return Arrays.stream(clazz.getClasses()).anyMatch(
            c -> c.getSimpleName().equals(JavaDataTemplateGenerator.PROJECTION_MASK_CLASSNAME));
      }
      catch (ClassNotFoundException e)
      {
        // Ignore, and check if the class will be generated from a source PDL
      }
      return isGeneratedFromSource(templateSpec);
    });
  }
@Test
  public void testHasProjectionMaskApiClassFoundWithProjectionMask() throws  Exception
  {
    ProjectionMaskApiChecker projectionMaskApiChecker = new ProjectionMaskApiChecker(
        _templateSpecGenerator, _sourceFiles, _classLoader);
    Mockito.when(_nestedTypeSource.getAbsolutePath()).thenReturn(pegasusDir + FS + "Bar.pdl");
    Mockito.when(_nestedType.fullName()).thenReturn(FakeRecordWithProjectionMask.class.getName());

    Assert.assertTrue(projectionMaskApiChecker.hasProjectionMaskApi(_nestedType, _templateSpec));
    Mockito.verify(_nestedType, Mockito.times(1)).fullName();
    Mockito.verify(_nestedTypeSource, Mockito.never()).getAbsolutePath();

    // Check caching
    Assert.assertTrue(projectionMaskApiChecker.hasProjectionMaskApi(_nestedType, _templateSpec));
    Mockito.verifyNoMoreInteractions(_nestedType);
  }