@Test public void getSerializer_immutableListWithSerializableContainedType_emptyReturned() { fakeSerializerFactory.setReturnIdentitySerializer(true); TypeMirror typeMirror = typeMirrorOf(ImmutableList.class); Optional<Serializer> actualSerializer = extension.getSerializer(typeMirror, fakeSerializerFactory, mockProcessingEnvironment); assertThat(actualSerializer).isEmpty(); }
@Override public Optional<Serializer> getSerializer( TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) { if (!isImmutableList(typeMirror)) { return Optional.empty(); } TypeMirror containedType = getContainedType(typeMirror); Serializer containedTypeSerializer = factory.getSerializer(containedType); if (containedTypeSerializer.isIdentity()) { return Optional.empty(); } return Optional.of(new ImmutableListSerializer(containedTypeSerializer, processingEnv)); }
ImmutableListSerializerExtension implements SerializerExtension { @Override public Optional<Serializer> getSerializer( TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) { if (!isImmutableList(typeMirror)) { return Optional.empty(); } TypeMirror containedType = getContainedType(typeMirror); Serializer containedTypeSerializer = factory.getSerializer(containedType); if (containedTypeSerializer.isIdentity()) { return Optional.empty(); } return Optional.of(new ImmutableListSerializer(containedTypeSerializer, processingEnv)); } }
ImmutableListSerializerExtension implements SerializerExtension { @Override public Optional<Serializer> getSerializer( TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) { if (!isImmutableList(typeMirror)) { return Optional.empty(); } TypeMirror containedType = getContainedType(typeMirror); Serializer containedTypeSerializer = factory.getSerializer(containedType); if (containedTypeSerializer.isIdentity()) { return Optional.empty(); } return Optional.of(new ImmutableListSerializer(containedTypeSerializer, processingEnv)); } ImmutableListSerializerExtension(); }
ImmutableListSerializerExtension implements SerializerExtension { @Override public Optional<Serializer> getSerializer( TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) { if (!isImmutableList(typeMirror)) { return Optional.empty(); } TypeMirror containedType = getContainedType(typeMirror); Serializer containedTypeSerializer = factory.getSerializer(containedType); if (containedTypeSerializer.isIdentity()) { return Optional.empty(); } return Optional.of(new ImmutableListSerializer(containedTypeSerializer, processingEnv)); } ImmutableListSerializerExtension(); @Override Optional<Serializer> getSerializer(
      TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv); }
ImmutableListSerializerExtension implements SerializerExtension { @Override public Optional<Serializer> getSerializer( TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) { if (!isImmutableList(typeMirror)) { return Optional.empty(); } TypeMirror containedType = getContainedType(typeMirror); Serializer containedTypeSerializer = factory.getSerializer(containedType); if (containedTypeSerializer.isIdentity()) { return Optional.empty(); } return Optional.of(new ImmutableListSerializer(containedTypeSerializer, processingEnv)); } ImmutableListSerializerExtension(); @Override Optional<Serializer> getSerializer(
      TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv);  }