@Test public void apply() throws Exception { final PsiType actual = underTest.apply(typeName); assertThat(actual) .isEqualTo(expected); }
@Nonnull @CheckReturnValue @Override public PsiType apply(@Nonnull TypeName typeName) { return Stream.of(PrimitiveType.values()) .filter(primitiveType -> primitiveType.isSameAs(typeName)) .map(PrimitiveType::psiType) .findFirst() .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE)); }
PsiTypeConverter implements Function<TypeName, PsiType> { @Nonnull @CheckReturnValue @Override public PsiType apply(@Nonnull TypeName typeName) { return Stream.of(PrimitiveType.values()) .filter(primitiveType -> primitiveType.isSameAs(typeName)) .map(PrimitiveType::psiType) .findFirst() .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE)); } }
PsiTypeConverter implements Function<TypeName, PsiType> { @Nonnull @CheckReturnValue @Override public PsiType apply(@Nonnull TypeName typeName) { return Stream.of(PrimitiveType.values()) .filter(primitiveType -> primitiveType.isSameAs(typeName)) .map(PrimitiveType::psiType) .findFirst() .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE)); } @Inject  PsiTypeConverter(@Nonnull PsiManager psiManager); }
PsiTypeConverter implements Function<TypeName, PsiType> { @Nonnull @CheckReturnValue @Override public PsiType apply(@Nonnull TypeName typeName) { return Stream.of(PrimitiveType.values()) .filter(primitiveType -> primitiveType.isSameAs(typeName)) .map(PrimitiveType::psiType) .findFirst() .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE)); } @Inject  PsiTypeConverter(@Nonnull PsiManager psiManager); @Nonnull @CheckReturnValue @Override PsiType apply(@Nonnull TypeName typeName); }
PsiTypeConverter implements Function<TypeName, PsiType> { @Nonnull @CheckReturnValue @Override public PsiType apply(@Nonnull TypeName typeName) { return Stream.of(PrimitiveType.values()) .filter(primitiveType -> primitiveType.isSameAs(typeName)) .map(PrimitiveType::psiType) .findFirst() .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE)); } @Inject  PsiTypeConverter(@Nonnull PsiManager psiManager); @Nonnull @CheckReturnValue @Override PsiType apply(@Nonnull TypeName typeName);  }