@Test public void non_specimen_type_request_returns_no_specimen() { Object result = this.mapBuilder.create("string", null); assertEquals(new NoSpecimen(), result); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType)request; Class requestClass = specimenType.getRawType(); if (!Map.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashMap(); }
MapBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType)request; Class requestClass = specimenType.getRawType(); if (!Map.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashMap(); } }
MapBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType)request; Class requestClass = specimenType.getRawType(); if (!Map.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashMap(); }  }
MapBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType)request; Class requestClass = specimenType.getRawType(); if (!Map.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashMap(); }  @Override Object create(Object request, SpecimenContext context); }
MapBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType)request; Class requestClass = specimenType.getRawType(); if (!Map.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashMap(); }  @Override Object create(Object request, SpecimenContext context);  }