private boolean canBeNarrowingPrimitiveConversion(TypeMirror type){
  TypeMirror unboxedType=TypesUtils.isBoxedPrimitive(type) ? types.unboxedType(type) : type;
  TypeKind unboxedKind=unboxedType.getKind();
  return unboxedKind == TypeKind.BYTE || unboxedKind == TypeKind.SHORT || unboxedKind == TypeKind.CHAR;
}

private boolean canBeNarrowingPrimitiveConversion ( TypeMirror type ) { TypeMirror unboxedType = TypesUtils . isBoxedPrimitive ( type ) ? types . unboxedType ( type ) : type ; TypeKind unboxedKind = unboxedType . getKind ( ) ; return unboxedKind == TypeKind . BYTE || unboxedKind == TypeKind . SHORT || unboxedKind == TypeKind . CHAR ; }
all other narrowings require a cast . for example : byte b = 100 ; see jls 5 . 1 . 3
