ClassObjectFormatter extends ObjectFormatter { @Override public boolean acceptType(Type type, Map<String, Object> options) { return super.acceptType(type, options) && (type.signature().charAt(0) == CLASS_OBJECT || type.signature().equals(CLASS_SIGNATURE)); } ClassObjectFormatter(BiFunction<Type, Map<String, Object>, String> typeStringFunction); @Override boolean acceptType(Type type, Map<String, Object> options);  }
@Test public void testAcceptType() throws Exception { ObjectReference foo = this.getObjectReference("Foo"); assertFalse("Should not accept null type.", formatter.acceptType(null, new HashMap<>())); assertFalse("Should not accept Foo type.", formatter.acceptType(foo.referenceType(), new HashMap<>())); ObjectReference str = this.getObjectReference("java.lang.String"); assertFalse("Should not accept String type.", formatter.acceptType(str.referenceType(), new HashMap<>())); ObjectReference clz = this.getObjectReference("java.lang.Class"); assertTrue("Should accept Class type.", formatter.acceptType(clz.referenceType(), new HashMap<>())); LocalVariable list = this.getLocalVariable("strList"); assertFalse("Should not accept List type.", formatter.acceptType(list.type(), new HashMap<>())); LocalVariable arrays = this.getLocalVariable("arrays"); assertFalse("Should not accept array type.", formatter.acceptType(arrays.type(), new HashMap<>())); }