private void handleReplaceCalls() { if (!hasAddedRandom && Random.wasAccessed()) { hasAddedRandom = true; try { cluster.addTestCall( new GenericMethod(Random.class.getMethod("setNextRandom", new Class<?>[] { int.class }), new GenericClass(Random.class))); } catch (SecurityException | NoSuchMethodException e) { logger.error("Error while handling Random: " + e.getMessage(), e); } } if (!hasAddedSystem && org.evosuite.runtime.System.wasTimeAccessed()) { hasAddedSystem = true; try { cluster.addTestCall( new GenericMethod(System.class.getMethod("setCurrentTimeMillis", new Class<?>[] { long.class }), new GenericClass(System.class))); } catch (SecurityException e) { logger.error("Error while handling System: " + e.getMessage(), e); } catch (NoSuchMethodException e) { logger.error("Error while handling System: " + e.getMessage(), e); } } }