Type { public final Type getFresh() { return this.getFresh(new TypeScope()); }  int countArguments(); String prettyPrint(); abstract String prettyPrint(final int fixity); final Type getFresh(); abstract Type getFresh(final TypeScope scope); abstract Type getConcrete(); abstract boolean containsOccurenceOf(TypeVar tvar); @Override abstract String toString(); void enforcePolymorphism(); Optional<Type> defaultedConcreteType(ConcreteType backupFiller); final static TypeCon con(String name); final static Type con(String name, Type... args); final static Type fun(Type... elems); final static Type app(Type... elems); final static Type listOf(Type elem); final static Type tupleOf(Type... elems);  }
@Test public final void getFreshTest() { TypeScope scope = new TypeScope(); final Type t = Type.tupleOf( Type.listOf(scope.getVar("a")), Type.fun( scope.getVar("b"), Type.con("String") ) ); assertFalse(t == t.getFresh()); assertEquals(t.prettyPrint(), t.getFresh().prettyPrint()); }