12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/*
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * Copyright (C) 2008 The Guava Authors
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) *
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * Licensed under the Apache License, Version 2.0 (the "License");
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * you may not use this file except in compliance with the License.
61320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * You may obtain a copy of the License at
71320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci *
81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * http://www.apache.org/licenses/LICENSE-2.0
91320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci *
101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * Unless required by applicable law or agreed to in writing, software
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * distributed under the License is distributed on an "AS IS" BASIS,
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) * See the License for the specific language governing permissions and
14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) * limitations under the License.
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) */
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)package com.google.common.collect.testing;
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)import java.util.Set;
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/**
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * Reserializes the sets created by another test set generator.
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) *
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * TODO: make CollectionTestSuiteBuilder test reserialized collections
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) *
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * @author Jesse Wilson
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) */
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)public class ReserializingTestSetGenerator<E>
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    extends ReserializingTestCollectionGenerator<E>
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    implements TestSetGenerator<E> {
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  ReserializingTestSetGenerator(TestSetGenerator<E> delegate) {
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    super(delegate);
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  }
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  public static <E> TestSetGenerator<E> newInstance(
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      TestSetGenerator<E> delegate) {
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    return new ReserializingTestSetGenerator<E>(delegate);
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  }
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  @Override public Set<E> create(Object... elements) {
422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    return (Set<E>) super.create(elements);
432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  }
442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)