MutableTypeDeclaration extends MutablePluginDeclaration<MutableTypeDeclaration> implements BareTypeDeclaration { public static MutableTypeDeclaration fromClass(Class<?> original, CopyOption... copyOptions) { return new MutableTypeDeclaration(original, copyOptions); } MutableTypeDeclaration(); private  MutableTypeDeclaration(Class<?> original, CopyOption[] copyOptions); private  MutableTypeDeclaration(BareTypeDeclaration original, CopyOption[] copyOptions); static MutableTypeDeclaration fromClass(Class<?> original, CopyOption... copyOptions); @Nullable static MutableTypeDeclaration copyOfTypeDeclaration(@Nullable BareTypeDeclaration original,
            CopyOption... copyOptions); @Override boolean equals(@Nullable Object otherObject); @Override int hashCode(); @Override String toString(); @Override @Nullable T accept(BarePluginDeclarationVisitor<T, P> visitor, @Nullable P parameter); @XmlElementRef @Override @Nullable MutableTypeMirror<?> getSuperclass(); MutableTypeDeclaration setSuperclass(@Nullable MutableTypeMirror<?> superclass); @XmlElement(name = "kind") @Override Kind getTypeDeclarationKind(); MutableTypeDeclaration setTypeDeclarationKind(Kind kind); @XmlElementWrapper(name = "type-parameters") @XmlElement(name = "type-parameter") @Override List<MutableTypeParameterElement> getTypeParameters(); MutableTypeDeclaration setTypeParameters(List<MutableTypeParameterElement> typeParameters); @XmlElementWrapper(name = "interfaces") @XmlElementRef @Override List<MutableTypeMirror<?>> getInterfaces(); MutableTypeDeclaration setInterfaces(List<MutableTypeMirror<?>> interfaces); @XmlElementWrapper(name = "nested-type-declarations") @XmlElementRef @Override List<MutableTypeDeclaration> getNestedTypeDeclarations(); MutableTypeDeclaration setNestedTypeDeclarations(List<MutableTypeDeclaration> nestedTypeDeclarations);  }
@Test public void fromClass() { MutableTypeDeclaration actual = MutableTypeDeclaration.fromClass(List.class); TypeVariable<?> typeVariable = List.class.getTypeParameters()[0]; MutableTypeDeclaration expected = new MutableTypeDeclaration() .setSimpleName(List.class.getSimpleName()) .setInterfaces(Collections.<MutableTypeMirror<?>>singletonList( new MutableDeclaredType() .setDeclaration(Collection.class.getName()) .setTypeArguments(Collections.<MutableTypeMirror<?>>singletonList( new MutableTypeVariable() .setFormalTypeParameter(typeVariable.getName()) )) )) .setTypeDeclarationKind(BareTypeDeclaration.Kind.INTERFACE) .setTypeParameters(Collections.singletonList( new MutableTypeParameterElement() .setSimpleName(typeVariable.getName()) )); Assert.assertEquals(actual, expected); }